Describes the name and type information for the columns of a cursor.
sa_describe_cursor( cursor_name )
cursor_name This VARCHAR(256) value identifies the open cursor to describe.
Column name | Data type | Description |
---|---|---|
column_number | INTEGER | The ordinal position of the column described by this row, starting at 1. |
name | VARCHAR(128) | The name of the column. |
domain_id | SMALLINT | The data type of the column. See SYSDOMAIN system view. |
domain_name | VARCHAR(128) | The data type name of the column. See SYSDOMAIN system view. |
domain_name_with_size | VARCHAR(160) | The data type name, including size and precision (as used in CREATE TABLE or CAST functions). |
width | INTEGER | The length of a string parameter, the precision of a numeric parameter, or the number of bytes of storage for any other data type. |
scale | INTEGER | The number of digits after the decimal point for numeric data type columns, and zero for all other data types. |
declared_width | INTEGER | The length of a string parameter, the precision of a numeric parameter, or the number of bytes of storage for any other data type. |
user_type_id | SMALLINT | The user-defined data type if applicable, otherwise NULL. See SYSUSERTYPE system view. |
user_type_name | VARCHAR(128) | The user-defined data type if applicable, otherwise NULL. See SYSUSERTYPE system view. |
correlation_name | VARCHAR(128) | The correlation name associated with the expression if applicable, otherwise NULL. |
base_table_id | UNSIGNED INTEGER | The table_id if the expression is a column, otherwise NULL. See SYSTAB system view. |
base_column_id | UNSIGNED INTEGER | The column_id if the expression is a column, otherwise NULL. See SYSTABCOL system view. |
base_owner_name | VARCHAR(128) | The owner name if the expression is a column, otherwise NULL. See SYSUSER system view. |
base_table_name | VARCHAR(128) | The table name if the expression is a column, otherwise NULL. |
base_column_name | VARCHAR(128) | The column name if the expression is a column, otherwise NULL. |
nulls_allowed | BIT | The indicator whether the expression can be NULL (1). |
is_autoincrement | BIT | An indicator whether the expression is an autoincrement column (1). |
is_key_column | BIT | An indicator whether the expression is part of a key for the result set (1). See the Remarks section below for more information. |
is_added_key_column | BIT | An indicator whether the expression is an added key column (1). See the Remarks section below for more information. |
The sa_describe_cursor system procedure provides an API-independent mechanism for retrieving the description of the columns returned by the cursor. The system procedure can be useful when writing stored procedures that work with dynamic SQL.
The sa_describe_cursor system procedure can be used in a CALL statement or in the FROM clause of a SELECT statement.
cursor_name must refer to an open cursor in the current connection. Use the sa_list_cursors system procedure to get the list of open cursors for the connection. See sa_list_cursors system procedure.
None
None
Discuss this page in DocCommentXchange.
|
Copyright © 2010, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.0 |