SQL Programming Manual for TAL

Examples of Dynamic NonStop SQL Programs
HP NonStop SQL Programming Manual for TAL527887-001
C-40
Detailed Dynamic SQL Program
1201. 001205 1 2
1202. 001205 1 2 ! Disable SQL warning checking
1203. 001205 1 2 EXEC SQL WHENEVER SQLWARNING CONTINUE;
1204. 001205 1 2
1205. 001205 1 2 WHILE sqlcode >= 0 do ! continue fetching rows as
long as
1206. 001210 1 2 ! there are no errors or only warnings
1207. 001210 1 2 begin
1208. 001210 1 3 EXEC SQL FETCH c1 USING DESCRIPTOR :sda^o;
1209. 001264 1 3 if sqlcode = 100 then ! We've fetched all the rows
Page 31 [1] $VOL1.S04.TALDYN 1991-10-15 13:42:28
dyn^tal main procedure
1267. 002104 1 1 sqlcode := temp^sqlcode;
1268. 002106 1 1
1269. 002106 1 1 ! Re-enable WHENEVER checking:
1270. 002106 1 1 EXEC SQL WHENEVER SQLERROR GO TO :sql^error^handler;
1271. 002106 1 1
1272. 002106 1 1 END; !main
Page 32 [1] $VOL1.S04.TALDYN 1991-10-15 13:42:28
BINDER AND COMPILER STATISTICS
BINDER - OBJECT FILE BINDER - T9621C30 - (01NOV91) SYSTEM \SYS1
Copyright Tandem Computers Incorporated 1982-1989, 1991
Object file $VOL1.S04.TALD2O
TIMESTAMP 1991-10-15 13:42:28
5 Code pages
21 Primary data words
5365 Secondary data words
64 Data pages
0 Resident code pages
1 Extended data page
5386 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 = 40902 bytes
Number of source lines = 4184
Compile cpu time = 00:00:08
Total Elapsed time = 00:00:38