Used to describe a result set.
typedef struct an_extfn_result_set_column_info { char * column_name; a_sql_data_type column_type; a_sql_uint32 column_width; a_sql_uint32 column_index; short int column_can_be_null; } an_extfn_result_set_column_info; |
column_name Points to the name of the column which is a null-terminated string.
column_type Indicates the type of the column. This is one of the Embedded SQL data types such as DT_INT, DT_FIXCHAR, or DT_BINARY. See Embedded SQL data types.
column_width Defines the maximum width for char(n), varchar(n) and binary(n) declarations and is set to 0 for all other types.
column_index The ordinal position of the column which starts at 1.
column_can_be_null Set to 1 if the column is nullable; otherwise it is set to 0.
The following code fragment shows how to set the properties for objects of this type and how to describe the result set to the calling SQL environment.
// set up column descriptions // DepartmentID INTEGER NOT NULL col_info[0].column_name = "DepartmentID"; col_info[0].column_type = DT_INT; col_info[0].column_width = 0; col_info[0].column_index = 1; col_info[0].column_can_be_null = 0; // DepartmentName CHAR(40) NOT NULL col_info[1].column_name = "DepartmentName"; col_info[1].column_type = DT_FIXCHAR; col_info[1].column_width = 40; col_info[1].column_index = 2; col_info[1].column_can_be_null = 0; extapi->set_value( arg_handle, EXTFN_RESULT_SET_ARG_NUM, (an_extfn_value *)&rs_info, EXTFN_RESULT_SET_DESCRIBE ); |
Discuss this page in DocCommentXchange. Send feedback about this page using email. |
Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1 |