Returns the column privileges for one or more specified table columns as a result set on the statement handle.
hstmnt=DB_ColumnPrivileges (hdbc, catalog-name, schema-name, table-name, column-name)
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. |
column-name |
String search pattern for column names. STRING. |
Wildcard character | Matches |
---|---|
% | The percent sign matches any character sequence. |
_ | The underscore matches any single character. |
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.
To retrieve the column privileges for a specific table:
[ ] STRING cat, sch, table, col, ignore, column-name, privileges [ ] hstmnt = DB_ColumnPrivileges (hdbc, cat, sch, table, col) [ ] // retrieve only column and privileges; ignore the rest. [-] while (DB_FetchNext (hstmt, ignore, ignore, ignore, column-name, ignore, ignore, privileges) == TRUE) { [ ] //print columns and privileges ... [-] }