SQL Programming Manual for TAL

NonStop SQL Version Issues
HP NonStop SQL Programming Manual for TAL527887-001
D-7
Migrating a C10 Program to Access Version 2
Objects
To use a C10 SQLDA structure, specify the RELEASE1 option either in the
INCLUDE SQLDA directive or in the SQL directive for the TAL compiler.
Migrating a C10 Program to Access Version 2
Objects
If a release C10 program needs to access Version 2 objects or catalogs, consider
these issues:
Dynamic SQL operations
Static SQL operations
Catalog tables
Dynamic SQL Operations
Dynamic SQL programs use the SQLDA to specify input and output variables used in
dynamic SQL statements.
The release C30 SQLDA has a new field named PRECISION that supplies precision
information when a column of FLOAT, REAL, DOUBLE PRECISION, DATETIME,
DATE, TIME, TIMESTAMP, or INTERVAL data type is accessed. If the program
accesses columns of these data types, the program must provide a release C30
SQLDA structure. When the release C30 structure is provided, precision information is
also returned when columns of other data types are accessed.
In addition to the PRECISION field, two other significant changes have been made to
the release C30 SQLDA for null support:
The NULL^INFO field, unused in the release C10 SQLDA, is now set to -1 if a null
value is allowed in the corresponding SELECT column. The value is allowed to be
null only if the column definition permits a null value.
The RESERVED field has been renamed IND^PTR. The IND^PTR field is similar
to the VAR^PTR field, but is for the extended address of a null indicator variable.
The extended address is not returned by NonStop SQL; the program must initialize
IND^PTR to point to the input and output indicator variables that it has declared
and allocated.
Dynamic SQL programs accessing null values or Version 2 data types can either use
the INCLUDE SQLDA directive to generate an SQLDA structure or include the SQLDA
declaration code in the source file. Existing programs that include the SQLDA
declaration code must use the release C30 SQLDA structure to access columns with
Version 2 data types.
If program code initializes the SQLDA structure, the code must set the correct version
value in the SQLDA EYE^CATCHER field to match the SQLDA version. The value
“DA” indicates a release C10 SQLDA; the value “D1” indicates a release C30 SQLDA.