SQL Programming Manual for Pascal

Using Dynamic SQL
HP NonStop SQL Programming Manual for Pascal528614-001
7-21
Dynamically Allocating Memory
ALLOCATE_SQLDA contains code like that shown in Figure 7-5 on page 7-22. Note
the use of the variable GENERIC_PTR to circumvent type checking.
Figure 7-4. Preparing to Allocate the SQLDA
NUM_INPUT_VARS := SQLSA.PREPARE.INPUT_NUM;
{get the number of input parameters from the SQLSA}
IF (NUM_INPUT_VARS > 0) THEN
BEGIN
INPUT_NAMESBUF_SIZE := SQLSA.PREPARE.INPUT_NAMES_LEN;
{ get the size of the input names buffer from the SQLSA}
ALLOCATE_SQLDA(INPUT_SQLDA_PTR,
NUM_INPUT_VARS,
INPUT_NAMESBUF_PTR,
INPUT_NAMESBUF_SIZE);
END;
VST0704.vsd