Example: lrd_col_data

In the following example, lrd_col_data sets a pointer to the data, to enable the printing of the data in the grid. The first segment shows the recorded script in the Actions section. The second section shows the corresponding section (PrintRow1) in the print.inl file generated during recording. Note that lrd_col_data was used only when the results could not be bound by lrd_bind_col (realval and address).

 /* Actions section from run.c */
lrd_stmt(Csr1, "select id, name, realval, address from names", -1, 1, 0, 0 );
lrd_bind_col(Csr1, 1, &ID_D21, 0, 0);
lrd_bind_col(Csr1, 2, &NAME_D22, 0, 0);
lrd_fetch(Csr1, -5, 1, 0, PrintRow1, 0);
 /* VuGen displays a table displaying all five rows. */
 / * PrintRow1 section from print.inl. */
LRD_PRINT_ROW_PROTO(PrintRow1)
{
    LRDRET gjLRDRet = LRDRET_I_OK;
    char szID_D21[256];
    char szNAME_D22[256];
    char szREALVAL_D23[256];
    char szADDRESS_D24[256];
    lrd_to_printable(&ID_D21, 0, szID_D21, 256, "");
    lrd_to_printable(&NAME_D22, 0, szNAME_D22, 256, "");
    lrd_col_data(Csr1, 3, 0, &REALVAL_D23, &uliActualLength, 0);
    lrd_to_printable(&REALVAL_D23, 0, szREALVAL_D23, 256, "");
    lrd_col_data(Csr1, 4, 0, &ADDRESS_D24, &uliActualLength, 0);
    lrd_to_printable(&ADDRESS_D24, 0, szADDRESS_D24, 256, "");
    return gjLRDRet;
}