Please enable JavaScript to view this site.

ESL Documentation

Level 2 subroutine

Return an array of structures containing columns and privileges.

call EDSColumnPrivileges(HSTMT_IV, EDSTABLE_STRUCT, COLUMNNAME_SV, MAXROWS_IV, NUMROWS_IV, ARRAY_STRUCT ) 

HSTMT_IV An integer input value that indicates the statement handle.

EDSTABLE_STRUCT An EDS input table structure that contains the following: QUALIFIER_SV A string input value that indicates the table qualifier.

OWNER_SV A string input value that contains the string search pattern for table owner names.

NAME_SV A string input value that contains the string search pattern for a table name.

COLUMNNAME_SV A string input value that contains the string search pattern for column names.

MAXROWS_IV An integer input value that indicates the maximum number of rows in the result array.

NUMROWS_IV An integer output value that indicates the actual number of rows in the result array.

ARRAY_STRUCT An output array of EDSCOLPRIV_STRUCT structures that contain the result set.

 

Description

The COLUMNNAME argument accepts a search pattern.  For more information about valid search patterns, see Search Pattern Arguments in Catalog Commands.

EDSColumnPrivileges returns the results as an array of structures, ordered by TABLE_QUALIFIER, TABLE_OWNER, TABLE_NAME, COLUMN_NAME, and PRIVILEGE. The following table lists the columns in the result set.

Column Name

Data Type

Comments

TABLE_QUALIFIER  

string

Table qualifier identifier;. NULL if not applicable to the data source

TABLE_OWNER

string

Table owner identifier;

NULL if not applicable to the data source.

TABLE_NAME

string not NULL

Table identifier

COLUMN_NAME

string not NULL

Column identifier.

GRANTOR

string

Identifier of the user who granted the privilege;

 

NULL if not applicable to the data source.

GRANTEE

string not NULL

Identifier of the user to whom the privilege was granted.

PRIVILEGE

string not NULL

Identifier of the column privilege. May be one of the following or others supported by the data source when implementation-defined.

 

SELECT: the grantee is permitted to retrieve data for the column.

INSERT: the grantee is permitted to provide data for the column in new rows that are inserted into the associated table.

UPDATE: the grantee is permitted to update data in the column.

REFERENCES: the grantee is permitted to refer to the column within a constraint (for example, a unique, referential, or table check constraint).

IS_GRANTABLE

string

Indicates whether the grantee is permitted to grant the privilege to other users; “YES”, “NO” or NULL if unknown or not applicable to the data source.

Return Values

EDSColumnPrivileges returns EDS_SUCCESS, EDS_INVALID_HANDLE, or EDS_ERROR.

When EDSColumnPrivileges returns EDS_ERROR, you can obtain an associated SQLSTATE value with more specific information by calling EDSError. The following table lists each typical SQLSTATE value and explains each one in the context of the command EDSColumnPrivileges.

The following table lists possible SQLSTATE values.

SQL

STATE

Error

Description

08S01

Communication link failure

The communication link between the driver and the data source to which the driver was connected failed before the function completed processing.

24000

Invalid cursor state

Results were pending on the statement handle from a previous SELECT statement or a cursor associated with the statement handle had not been closed.

IM001

Driver does not support this function

The driver associated with the statement handle does not support the function.

S1000

General error

An error occurred for which there was no specific SQLSTATE and for which no implementation-specific SQLSTATE was defined. The error message returned by EDSError in the argument ERRORTEXT describes the error and its cause.

S1001

Memory allocation failure

The driver was unable to allocate memory required to support execution or completion of the function.

S1008

Operation cancelled

Asynchronous processing was enabled for the statement handle. The function was called and before it completed execution, EDSCancel was called on the statement handle. Then the function was called again on the statement handle.

S1010

Function

An asynchronously executing function (not this sequence error one) was called for the statement handle and was still executing when this function was called.

S1090

Invalid string or

The value of one of the name length arguments buffer length was less than 0.

S1C00

Driver not capable

A table qualifier or a table owner was specified and the driver or data source does not support one or both of the qualifiers. A string search pattern was specified for the table owner, table name, or column name, and the data source does not support search patterns for one or more of those arguments.

S1T00

Timeout expired

The timeout period expired before the data source returned the result set. The timeout period is set through EDSSetStmtOption, EDS_QUERY_TIMEOUT.

See Also

EDSBindCol assigns an ESL variable for a column in a result set.
EDSCancel cancels statement processing.
EDSColumns returns the columns in a table or tables.
EDSExtendedFetch fetches a block of data or scrolls through a result set.
EDSFetch fetches a row of data.
EDSTables lists the tables in a data source.
EDSTablePrivileges lists privileges for a specified table or tables.