SQL Programming Manual for TAL

Examples of Dynamic NonStop SQL Programs
HP NonStop SQL Programming Manual for TAL527887-001
C-9
Detailed Dynamic SQL Program
Detailed Dynamic SQL Program
The TALDYN program allows a user to enter any SQL statement at run time. TALDYN
prepares and executes the statement in a TMF transaction. The program is
independent of a specific database because it does not use database definitions. Only
the dynamic SQL statement refers to a particular database.
TALDYN performs these functions:
1. Declares these SQL structures:
An SQLSA to determine the number of input parameters or output variables.
One SQLDA to describe input parameters and another SQLDA to describe
output variables (Because the program allocates memory at run time, it
declares the SQLDA as a template and then allocates the actual structures
dynamically when the query is run.).
2. Defines these items:
A buffer to store output variables, with storage for column values of different
data types.
A buffer to store input parameters, with storage for parameter values of
different data types.
Page 7 [1] $VOL1.S04.TALDYNEZ 1991-10-15 13:41:54
BINDER AND COMPILER STATISTICS
BINDER - OBJECT FILE BINDER - T9621C30 - (01NOV91) SYSTEM \SYS1
Copyright Tandem Computers Incorporated 1982-1989, 1991
Object file $VOL1.S04.TALD1O
TIMESTAMP 1991-10-15 13:41:54
2 Code pages
14 Primary data words
1260 Secondary data words
64 Data pages
0 Resident code pages
1 Extended data page
1274 Top of stack location in words
1 Code segment
0 Binder Warnings
0 Binder Errors
TAL - Transaction Application Language - T9250C30 - (01NOV91)
Number of compiler errors = 0
Number of unsuppressed compiler warnings = 0
Number of warnings suppressed by NOWARN = 0
Maximum symbol table space used was = 28620 bytes
Number of source lines = 3165
Compile cpu time = 00:00:03
Total Elapsed time = 00:00:29