SQL Programming Manual for TAL
NonStop SQL Version Issues
HP NonStop SQL Programming Manual for TAL—527887-001
D-8
Static SQL Operations
If the dynamic SQL program is designed to handle null values, the program must
allocate indicator variables and initialize the IND^PTR field in addition to the VAR^PTR
field. To migrate a C10 program to access columns defined to allow null values or use
Version 2 data types, you must TAL compile and SQL compile the program with
release C30 compilers.
Static SQL Operations
The SQLDA structure is generated automatically by the language compiler for static
SQL operations. The SQLDA has additional fields for C30 to accommodate new data
types. To migrate a C10 program to access columns defined with the new data types,
add code to manage null values and host variables for new data types. Then compile
the program with the C30 TAL compiler and the C30 SQL compiler.
Catalog Tables
The COLUMNS and FILES catalog tables have new columns in Version 2. To migrate
programs that query these catalog tables, you might need to recode to accommodate
the new columns. For the new columns, see Table D-3
on page D-3 earlier in this
appendix; for detailed information about the catalog tables, see the
NonStop SQL
Installation and Management Manual.
Summary
Table D-5 summarizes the points in the preceding discussion.
Installing Migrated Programs
You can upgrade a release C10 system to release C30 system and continue executing
existing programs. The recommended procedure for installing programs includes SQL
compiling all SQL program object files with the C30 SQL compiler. SQL compilation
performs error checking for potential version problems.
The steps to install migrated programs are:
Table D-5. Accessing Version 2 Objects from a C10 Program
Situation Action To Take
Dynamic SQL
statements
Generate a RELEASE2 SQLDA structure. If handling null
values, allocate indicator variables and initialize the IND^PTR
field for each SQLVAR entry in the SQLDA. TAL and SQL
compile with C30.
Static SQL statements Add code to manage null values and to manage host variables
for new data types. TAL and SQL compile with C30 software.
Statements that query
catalog table COLUMNS
or FILES
If necessary, recode to accommodate new columns and new
column values. TAL and SQL compile with C30.