DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

dbWriteRecord(3dba)


dbWriteRecord -- write a record to the log database

Synopsis

cc [flag ...] file ... -kthread -leels [library] ...
#include <eelsdba.h>

int dbWriteRecord( DBConn *conn, DBRecordHeader_t *header, char *tablename, char *data, int size);

Description

dbWriteRecord writes a record to the log database. The header specified in the call is a DBRecordHeader_t structure which contains all of the header information that is to be logged with the record.

The data parameter specifies the data to be logged with the message. If there is a large amount of event specific information to be logged with a record, dbWriteRecord makes repeated internal calls to the database to add multiple rows with increasing sequence numbers.

When dbGetNextRow(3dba) is used to retrieve a row that contains event specific information in excess of the maximum record size supported by the database, additional entries with increasing sequence numbers are extracted from the database. In order to assemble the entire log entry, all the rows with matching UniqEventIDs should be gathered in SequenceNumber order.

Arguments


conn
(Input) A database connection that was returned by a previous call to dbConnect(3dba).

header
(Input) A pointer to a log record header structure as defined in Intro(3dba).

tablename
(Input) The name of the table that will contain the record information.

data
(Input) The data that is to be logged with the record.

size
(Input) The size of data in bytes.

Return values

If successful, dbWriteRecord returns 0. Otherwise, it returns -1.

Diagnostics

An application can call dbGetError(3dba) to obtain the error message returned from the database.

References

dbConnect(3dba), dbGetError(3dba), dbGetNextRow(3dba), Intro(3dba)


© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004