Determine whether the source of a regular result column is updatable through the DB-Library browse-mode facilities.
DBBOOL dbcolbrowse(dbproc, colnum) DBPROCESS *dbproc; int colnum;
A pointer to the DBPROCESS structure that provides the connection for a particular front-end/server process. It contains all the information that DB-Library uses to manage communications and data between the front end and server.
The number of the result column of interest. Column numbers start at 1.
“TRUE” or “FALSE.”
dbcolbrowse is one of the DB-Library browse mode routines. See Chapter 1, “Introducing DB-Library” for a detailed discussion of browse mode.
dbcolbrowse provides a way to determine whether the database column that is the source of a regular (that is, non-compute) result column in a select list is updatable using the DB-Library browse-mode facilities. This routine is useful in examining ad hoc queries. If the query has been hard-coded into the program, dbcolbrowse obviously is unnecessary.
To be updatable, a column must be derived from a browsable table (that is, the table must have a unique index and a timestamp column) and cannot be the result of a SQL expression. For example, in the following select list:
select title, category=type,
wholesale=(price * 0.6) ... for browse
result columns 1 and 2 (“title” and “category”) are updatable, but column 3 (“wholesale”) is not, because it is the result of an expression.
The application can call dbcolbrowse anytime after dbresults.
To determine the name of the source column given the name of the result column, use dbcolsource.
The sample program example7.c contains a call to dbcolbrowse.
dbcolsource, dbqual, dbtabbrowse, dbtabcount, dbtabname, dbtabsource, dbtsnewlen, dbtsnewval, dbtsput