tableExists
You are looking at an older version of the documentation. The latest version is found here.
This procedure checks if the table exists in the current virtual database. It simplifies the connector code by providing a simplified interface to accomplish a common task: check whether the table already exists in the current VDB. This procedure allows avoiding recurring code blocks that may introduce typos and errors.
Parameters
Parameter | Description |
---|---|
tableName | Fully-qualified name of the table |
Attributes
Attribute | Type |
---|---|
| boolean |
Example
BEGIN
IF ((CALL UTILS.tableExists ('dwh.SampleTable')))
BEGIN
SELECT 'yes';
END
ELSE
BEGIN
Error 'no';
END
END;;
The procedure encapsulates the query for the name of the current VDB and formats the table name with double quotes. This way, you need not worry about the correct casing of the schema and table names.