dbwritetext

Description

Send a text or image value to the server.

Syntax

RETCODE dbwritetext(dbproc, objname, textptr, 
                  textptrlen, timestamp, log, 
                  size, text)
 
DBPROCESS    *dbproc;
char                   *objname;
DBBINARY        *textptr;
DBTINYINT         textptrlen;
DBBINARY        *timestamp;
DBBOOL             log;
DBINT                 size;
BYTE                 *text;

Parameters

dbproc

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.

objname

The database table and column name that is separated by a period.

textptr

A pointer to the text pointer of the text or image value to be modified. This can be obtained by calling dbtxptr. The text pointer must be a valid one, as described on the dbtxptr reference page.

textptrlen

This parameter is included for future compatibility. For now, its value must be the defined constant DBTXPLEN.

timestamp

A pointer to the text timestamp of the text or image value to be modified. This can be obtained using dbtxtimestamp or dbtxtsnewval. This value changes whenever the text or image value itself is changed. This parameter is optional and may be passed as NULL.

log

A boolean value specifying whether this dbwritetext operation should be recorded in the transaction log.

size

The total size, in bytes, of the text or image value to be written. Since dbwritetext uses this parameter as its only guide to determining how many bytes to send, size must not exceed the actual size of the value.

text

The address of a buffer containing the text or image value to be written. If this pointer is NULL, the application must subsequently call dbmoretext one or more times, until all size bytes of data have been sent to the server.

Returns

SUCCEED or FAIL.

A common cause for failure is an invalid timestamp parameter. This occurs if, between the time the application retrieves the text column and the time the application calls dbwritetext to update it, a second application intervenes with its own update.

Usage

See also

dbmoretext, dbtxptr, dbtxtimestamp, dbwritetext, dbtxtsput