usumhit

Computes the specified aggregate computation or computations when called for all selected records in Select mode 4.

void usumhit(uc);

struct uctrl *uc;

Parameters

uc—address of the current control block.

Return Values

Not applicable.

Description

Computes the specified aggregate computation or computations when called for all selected records in Select mode 4.

When usumhit is called, the fields involved in the aggregate computation, the actual lengths of the fields, and the record must be available to Uniface.

This example returns records that are found during the Select connector request. The usumhit service function is called to calculate the aggregate when the mode of request is 4.

The DrvAdminType data type is created for this example, it holds the PRA in its PRA 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 );
}
}
}