tableExists
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.