Share this page

# lrd_col_data

Sets a pointer indicating the location of data.

    LRDRET lrd_col_data( LRD_CURSOR *mptCursor, unsigned int muiColNum, long mliOffset, LRD_VAR_DESC *mptVarDesc, unsigned long *mpuliFetchedLen, int miDBErrorSeverity);

mptCursor | A pointer to an LRD_CURSOR structure.
muiColNum | The column number of the requested data (one-based).
mliOffset | The offset from the beginning of the column data.
mptVarDesc | A pointer to the descriptor of a variable which contains the fetched data.
mpuliFetchedLen | A pointer to the variable indicating the length of the fetched data.
miDBErrorSeverity | The Error Severity Levels of a failure in a database routine.

The lrd_col_data function sets a pointer to the data of a specific column. This function accesses data without performing a bind operation. Note that to reference data (through pointers) you must cast it to its appropriate type. lrd_col_data only appears in the print.inl file located in the script directory.

When you retrieve data using lrd_col_data, you must convert the character strings into printable data using lrd_to_printable.

For more details refer to the Function Header File lrd.h in the include directory.

## Return Values

See LRD Return Values.

## Parameterization

You cannot use standard parameterization for any arguments in this function.

## Example

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 <span style="font-style: normal;">run.c</span> */
    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 <span style="font-style: normal;">print.inl</span>. */
    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;
    }

Tips to improve your search results... VuGen Function Reference Version 26.1-26.3 Function Reference 26.1-26.3 All View Local Help Center View Online Help Center Version: