Retrieves a list of statistics about a single table and the indexes that are associated with the table. The information is returned as a result set on the statement handle.
hstmnt = DB_Statistics (hdbc, catalog-name, schema-name, table-name, unique, reserved)
| Variable | Description |
|---|---|
| hstmnt |
The returned handle to the executed SQL statement. This is an input parameter for other DBTester functions, for example DB_FetchNext. HSQL. |
| hdbc |
The handle to a database as returned by DB_Connect. HDATABASE. |
| catalog-name |
Catalog name. STRING. |
| schema-name |
String search pattern for schema names. STRING. |
| table-name |
String search pattern for table names. STRING. |
| unique | |
| reserved |
To omit a variable argument, which is not a required argument, specify the argument as an empty string ("").
When you receive a valid statement handle, you can call DB_FetchNext or DB_FetchPrevious to manipulate the information.
[ ] STRING cat, sch, tab-name, ignore
[ ] INTEGER i
[ ] hstmnt = DB_Statistics (hdbc, cat, sch, "", "1", "0")
[ ] // retrieve name of table to which stats apply and whether ix is unique; // ignore the rest.
[-] while (DB_FetchNext (hstmt, ignore, ignore, tab-name, i) == TRUE) {
[ ] //print table names and index info ...
[ ] }