Skip to main content
Skip table of contents

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

ParameterDescription
tableNameFully-qualified name of the table

Attributes

Attribute

Type

tableExists

boolean

 Example

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

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

ParameterDescription
tableNameFully-qualified name of the table

Attributes

Attribute

Type

tableExists

boolean

 Example

Example

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

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.