$function_name {$1:'val1'} {$2:'val2'} {$3:'val3'} {$4: 'val4'} {$5: 'val5'} {$6: 'val6'}
where {} mean an optional parameter, and $function_name means a name of the ODBC / DB2 CLI functions, listed above. Even though the ODBC and DB2 CLI specifications define the meaning of each ODBC / DB2 CLI function from the list above, in reality, it is specific to every single ODBC / DB2 CLI driver.
Examples
1. "$SQLTables" -- get a list of all tables in the current
database.
2. "$SQLTables $1:'%'" -- get a list of all tables in all
databases.
3. "$SQLTables $1:'%' $2:'' $3:''" -- get a list of databases
on the current connection's server.
4. "$SQLColumns $1:'DMS' $2:'dbo' $3:'test_tab'" -- get a
list of all columns of table "test_tab" that belongs to schema "dbo", catalog
"DMS".
Here is an example of the full format of the OTL stream extended syntax:
#define OTL_ODBC // or OTL_DB2_CLI
#include <otlv4.h>
...
otl_stream s(100,
"$SQLTables $1:'%'",
db);
...
while(!s.eof()){
s>>...;
}
...
With this new feature (OTL stream extended format), it is possible to
use OTL with ODBC data sources that do not have access to their system
data dictionaries via normal "system views", which makes it impossible
to query the system data dictionary as "SELECT * FROM a system view".
Therefore, the only way to query the system data dictionary is via
ODBC functions like SQLTables().
Copyright © 1996, 2007, Sergei Kuchin, email: skuchin@ispwest.com, skuchin@gmail.com .
Permission to use, copy, modify and redistribute this document for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies.