SQL Programming Manual for TAL
Error and Status Processing
HP NonStop SQL Programming Manual for TAL—527887-001
6-21
Example of Using the SQLDA
Example of Using the SQLDA
Assume you declare an SQLDA structure named SQLDAX and a names buffer named
NAMEBUF for allocation during compilation. The SQLDA structures must reserve
space for the 20 columns you plan to use in dynamic SQL statements. The names
buffer must reserve space for column names with a maximum length of 30 characters.
You code the INCLUDE SQLDA directive as:
EXEC SQL
INCLUDE SQLDA ( sqldax, 20, namebuf, 30 );
...
Figure 6-8 shows the SQLDA structure template generated by the TAL compiler.
DAY TO SECOND 21 _SQLDT_INT_QUAL_D_S
DAY TO FRACTION 22 _SQLDT_INT_QUAL_D_F
HOUR TO MINUTE 23 _SQLDT_INT_QUAL_H_MI
HOUR TO SECOND 24 _SQLDT_INT_QUAL_H_S
HOUR TO FRACTION 25 _SQLDT_INT_QUAL_H_F
SECOND TO SECOND 26 _SQLDT_INT_QUAL_S_S
SECOND TO FRACTION 27 _SQLDT_INT_QUAL_S_F
FRACTION TO FRACTION 28 _SQLDT_INT_QUAL_F_F
Table 6-7. Literal Declarations for Ranges of Date-Time Fields (page 2 of 2)
Range of Fields Value Literal Declaration