DB_ColumnPrivileges Function

Action

Returns the column privileges for one or more specified table columns as a result set on the statement handle.

Syntax

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.

Notes

  • DB_ColumnPrivileges corresponds to SQLColumnPrivileges. For additional information about SQLColumnPrivileges, see SQLColumnPrivileges Function.
  • The following wildcard characters are supported for arguments:
    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.

Example

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 ... 
[-] }
Note: If you are viewing this help topic in PDF format, this code sample might include line-breaks which are not allowed in scripts. To use this code sample in a script, remove these line-breaks.