DBSendItem
You can use the DBSendItem function to send to the data server the data that you wish to include in a query.
FUNCTION DBSendItem (sessID: LongInt; dataType: DBType;
len: Integer; places: Integer;
flags: Integer; buffer: Ptr;
asyncPB: DBAsyncParmBlkPtr): OSErr;
sessID
- The session ID that was returned by the
DBInit function.
dataType
- The data type for the data item that you are sending to the data server.
len
- The length of the data item that you are sending to the data server. The database extension and data server ignore the
len parameter if the data type has an implied length.
places
- The number of decimal places for the data item that you are sending to the data server. The database extension and data server ignore the
places parameter for all values of the dataType parameter except typeDecimal and typeMoney.
flags
- Set the
flags parameter to 0. There are no flags currently defined for the DBSendItem function.
buffer
- A pointer to the memory location of the data item that you want to send. When you use the
DBSendItem function to send an item of data to a data server, the database extension and data server format the data according to the data type, length, and decimal places you specify, convert it to a character string, and append the data to the query.
asyncPB
- A pointer to an asynchronous parameter block. If you do not want to call the function asynchronously, set this parameter to
NIL.
DESCRIPTION
The DBSendItem function sends a single data item to the data server. The database extension or the data server (depending on how the system is implemented) converts the data item to a character string and appends it to the query, just as the DBSend function appends a query program fragment to the query. The query is not executed until you call the DBExec function.
SPECIAL CONSIDERATIONS
The DBSendItem function may move or purge memory. You should not call this routine from within an interrupt, such as in a completion routine or a VBL task.
ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for the DBSendItem function are
| Trap macro | Selector |
| _DBSendItem | $0B07 |
RESULT CODES
| noErr | 0 | No error |
| rcDBError | -802 | Error trying to send item |
| rcDBBadSessID | -806 | Session ID is invalid |
| rcDBAsyncNotSupp | -809 | The database extension does not support asynchronous calls |
| rcDBPackNotInited | -813 | The InitDBPack function has not yet been called |
SEE ALSO
For a discussion of data types, see "Getting Query Results" beginning on page 12-37. For a description of the asynchronous parameter block, see page 12-56. See Listing 12-4 beginning on page 12-32 for an example of the use of the DBSendItem function in sending a query fragment. See page 12-77 for a description of the DBSend function. The DBExec function is described next.