ubldprim
ubldprim
builds the concatenated primary key for a record.
void
ubldprim
(uc, key)
struct uctrl
*uc;
unsigned char
*key;
Parameters
- uc—address of the current control block.
- key—address of the buffer in which the primary key is placed.
Return Values
Not applicable.
Description
ubldprim
builds the concatenated primary
key for a record. The result is stored in the user supplied key buffer.
When ubldprim
is
called, the values of the primary key fields must be available in
the general I/O buffer. With a field-level connector, the actual
length of the primary key fields must be available in the uflen
elements in the field list.
This example returns
records that are found during the Select connector request. When
the mode of request is 0 or 3, the ubldprim
service function
is used to construct the primary key needed to call the uaddrec
service function.
The example creates the DrvAdminType
data
type. The DrvAdminType data type holds the PRA in its PRA field
and the primary key in its PKBuffer
field.
Such a structure would usually be stored in the connector workspace
(uctrl->udrv
).
ReturnRecordsFoundInSelect ( struct uctrl *ControlBlock, DrvAdminType *ConnectorAdministration ) { unsigned char Dummy; if ( ControlBlock->umode == 1 || ControlBlock->umode == 2 ) { /* Ready: modes 1 and 2 do not require hit. */ } else { if ( ControlBlock->umode == 4 ) { usumhit ( ControlBlock ); } else { /* For modes 0 and 3 */ ubldprim ( ControlBlock, DrvAdministration->PKBuffer ); uaddrec ( ControlBlock, DrvAdministration->PRA, ControlBlock->uralen, DrvAdministration->PKBuffer, ControlBlock->uprimlen, (unsigned char*)Dummy, 0 ); } } }