SE_stream_describe_column

Describes a specified column for the given stream

Usage syntax

LONG SE_stream_describe_column
(SE_STREAM stream,
SHORT column,
SE_COLUMN_DEF *column_def);

Parameters
stream The stream handle
column The column to describe
column_def A structure containing the requested column definition
Description

SE_stream_describe_column describes a specified column for a given stream. Column numbers reference the column list from a given query or insert/update, not the table order. Column numbers are sequential, starting from one.

The resulting column definition is returned in an SE_COLUMN_DEF structure. Note: The SE_stream_describe_column function assumes that the application has allocated enough space for the SE_COLUMN_DEF structure.

typedef struct {

 CHAR  column_name[SE_MAX_COLUMN_LEN]; /* The column name */

 LONG  sde_type;                       /* The ArcSDE data type */

 LONG  size;                           /* The size of the column values */

 SHORT decimal_digits;                 /* Number of digits after decimal */

 BOOL  nulls_allowed;                  /* Allows NULL values */

 SHORT row_id_type;                    /* The column's row id type. This parameter

                                          is read-only. ArcSDE sets it internally whenever

                                          the table is described. */

} SE_COLUMN_DEF;

The column types (sde_type) are:

SE_SMALLINT_TYPE        /* 2-byte integer */

SE_INTEGER_TYPE         /* 4-byte integer */

SE_FLOAT_TYPE           /* 4-byte float */

SE_DOUBLE_TYPE          /* 8-byte float */

SE_STRING_TYPE          /* Null term. Character array */

SE_BLOB_TYPE            /* Variable length data */

SE_DATE_TYPE            /* Struct tm date */

SE_SHAPE_TYPE           /* Feature structure */

The row id types are:

SE_REGISTRATION_ROW_ID_COLUMN_TYPE_SDE

SE_REGISTRATION_ROW_ID_COLUMN_TYPE_USER

SE_REGISTRATION_ROW_ID_COLUMN_TYPE_NONE

SE_stream_describe_column can be called only after initializing a stream with a query or insert/update and before closing the stream.

SE_stream_describe_column is especially useful when an application is processing an end-user’s query without knowing the target table’s schema. After initializing the query, the application can determine the number of result columns with SE_stream_num_result_columns. The application calls SE_stream_describe_column for each result column. The information in the SE_COLUMN_DEF structure is used then to either bind output variables (using SE_stream_bind_output_column ) or to determine which SE_stream_get_* function to call after SE_stream_fetch.

Returns

SE_SUCCESS
SE_CONNECTION_IN_USE

SE_CONNECTION_LOCKED

SE_FUNCTION_SEQUENCE_ERROR

SE_INVALID_PARAM_VALUE

SE_INVALID_POINTER

SE_NOT_A_SELECT_STATEMENT

SE_SDE_NOT_STARTED