ct_br_column uses a CS_BROWSEDESC structure to return information about a column returned as the result of a browse-mode select. This information is useful when an application needs to construct a language command to update browse-mode tables.
A CS_BROWSEDESC structure is defined as follows:
/*
** CS_BROWSEDESC
** The Client-Library browse column description
** structure.
*/
typedef struct _cs_browsedesc
{
CS_INT status;
CS_BOOL isbrowse;
CS_CHAR origname[CS_MAX_NAME];
CS_INT orignlen;
CS_INT tablenum;
CS_CHAR tablename[CS_OBJ_NAME];
CS_INT tabnlen;
} CS_BROWSEDESC;
where:
status is a bitmask of the following symbols, on which a bitwise OR operation is performed:
CS_EXPRESSION indicates the column is the result of an expression, for example, “sum*2” in the query “select sum*2 from areas”.
CS_HIDDEN indicates that the column is a hidden column that has been exposed. See “Hidden keys”.
CS_KEY indicates that the column is a key column. See the ct_keydatareference page.
CS_RENAMED indicates that the column’s heading is not the original name of the column. Columns will have a different heading from the column name in the data base if they are the result of a query of the form:
select Author = au_lname from authors
isbrowse indicates whether or not the column can be browse-mode updated.
A column may be updated if it is not the result of an expression and if it belongs to a browsable table. A table is browsable if it has a unique index and a timestamp column.
isbrowse is set to CS_TRUE if the column can be updated and CS_FALSE if it cannot.
origname is the original name of the column in the database. origname is a null-terminated string.
Any updates to a column must refer to it by its original name, not the heading that may have been given the column in a select statement.
orignlen is the length, in bytes, of origname.
tablenum is the number of the table to which the column belongs. The first table in a select statement’s from list is table number 1, the second is number 2, and so forth.
tablename is the name of the table to which the column belongs. tablename is a null-terminated string.
tabnlen is the length, in bytes, of tablename.