Function SQLTableName(Datasource, TableNo, Owner)


With the function SQLTableName you can determine the name of a certain table in a datasource. This function is designed to be used in conjunction with the SQLNumberOfTables function.

     Datasource,          ! (input) a string expression
     TableNo,             ! (input) an integer expression
     Owner                ! (input/optional) a string expression



A string containing the name of a data source.


An integer containing the number of the table for which you want to retrieve the name. To determine the maximum value of this argument, please use the function SQLNumberOfTables prior to calling this function. The minimum value of this argument is 1.


A string containing the owner of the table for which the name must be determined. If the datasource doesn’t support the owner concept, but the owner argument is specified, an error will be raised.

Return Value

The function returns the name of the table, with the number as specified through the TableNo argument.


Typically, this function can best be used in a construction like the following:

NumberOfTables := SQLNumberOfTables("MyDataSource");

while LoopCount <= NumberOfTables do
    TableName := SQLTableName("MyDataSource", LoopCount);
    ! Do something with the retrieved table name here...

See also

The functions SQLNumberOfTables and SQLViewName.