home *** CD-ROM | disk | FTP | other *** search
- .Na "dbcolsource"
- .mc |
- .Aa
- .Fu
- Return a pointer to the name of the database column from which the specified regular result
- column was derived.
- .Ih "result column, returning database column corresponding to a"
- .Sy
- .Sf "char *dbcolsource(dbproc, colnum)"
- .Sp "DBPROCESS" "*dbproc"
- .Sp "int" "colnum"
- .Co
- .Bl
- \f2dbcolsource()\f1 is one of the \*L browse mode routines.
- It is usable only with results from a browse-mode SELECT (\f2i.e.,\f1
- a SELECT containing the key words FOR BROWSE).
- See the Introduction for a detailed discussion of browse mode.
- .Bl
- \f2dbcolsource()\f1 provides an application with information it needs to update
- a database column, based on an ad hoc query.
- SELECT statements may optionally specify header names for regular (\f2i.e.,\f1 non-compute)
- result columns:
- .SD
- .in +3n
- select author = au_lname from authors for browse
- .in -3n
- .ED
- When updating a table, you must use the database column name, not the header name
- (in this example, ``au_lname'', not ``author'').
- You can use the \f2dbcolsource()\f1 routine to get the underlying database column name:
- .SD
- .in +3n
- dbcolsource(dbproc, 1)
- .in -3n
- .ED
- This call will return a pointer to the string ``au_lname''.
- .Bl
- \f2dbcolsource()\f1 is useful for ad hoc queries.
- If the query has been hardcoded into the program, this routine is obviously unnecessary.
- .Bl
- The application can call
- \f2dbcolsource()\f1 any time after \f2dbresults()\f1.
- .Bl
- Example 7 in the \f2\*L Reference Supplement\f1 contains a call to \f2dbcolsource()\f1.
- .Bz
- .Pa
- .Pi dbproc
- A pointer to the DBPROCESS structure that provides the connection
- for a particular front-end/\*S process. It contains all the
- information that \*L uses to manage communications and data between the
- front end and \*S.
- .Pi colnum
- The number of the result column of interest. Column numbers start at 1.
- .in -.375i
- .Re
- .br
- A pointer to a null-terminated column name. This pointer will be NULL
- if the column number is out of range or if the column is the result
- of a SQL expression, such as ``max(colname)''.
- .Sa
- dbcolbrowse,
- dbqual,
- dbtabbrowse,
- dbtabcount,
- dbtabname,
- dbtabsource,
- dbtsnewlen,
- dbtsnewval,
- dbtsput
- .mc
-