Return the value of the text pointer for a column in the current row.
DBBINARY *dbtxptr(dbproc, column) DBPROCESS *dbproc; int column;
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 select list column of interest. Column numbers start at 1.
A DBBINARY pointer to the text pointer for the column of interest. This pointer may be NULL.
Every database column row of type SYBTEXT or SYBIMAGE has an associated text pointer, which uniquely identifies the text or image value. This text pointer is used by the dbwritetext function to update text and image values.
It is important that all the rows of the specified text or image column have valid text pointers. A text or image column row will have a valid text pointer if it contains data. However, if the text or image column row contains a null value, its text pointer will be valid only if the null value was explicitly entered with the update statement.
Assume a table textnull with columns key and x, where x is a text column that permits nulls. The following statement assigns valid text pointers to the text column’s rows:
update textnull
set x = null
On the other hand, the insert of a null value into a text column does not provide a valid text pointer. This is true for an insert of an explicit null or an insert of an implicit null, such as the following:
insert textnull (key)
values (2)
When dealing with a null text or image value, be sure to use update to get a valid text pointer.
An application must select a row containing a text or image value before calling dbtxptr to return the associated text pointer. The select causes a copy of the text pointer to be placed in the application’s DBPROCESS. The application can then retrieve this text pointer from the DBPROCESS using dbtxptr.
If no select is performed prior to the call to dbtxptr, the call will result in a DB-Library error message.
For an example that uses dbtxptr, see the dbwritetext reference page.