SQL Programming Manual for TAL

Examples of Dynamic NonStop SQL Programs
HP NonStop SQL Programming Manual for TAL527887-001
C-15
Detailed Dynamic SQL Program
Page 4 [1] $VOL1.S04.TALDYN 1991-10-15 13:42:28
99. 012365 0 1 FIXED(3) v^numeric = v^char;
100. 012365 0 1 REAL v^float = v^char;
101. 012365 0 1 REAL(64) v^double = v^char;
102. 012365 0 1 STRING v^decimal[0:18] = v^char;
103. 012365 0 1 STRING v^datetime[0:25] = v^char;
104. 012365 0 1 END;
105. 012365 0 0
106. 012365 0 0 --Copy in declarations for data type literals:
107. 012365 0 0 ?NOLIST, SOURCE $SYSTEM.SYSTEM.TALDECS(SQLDA)
109. 012365 0 0
111. 012365 0 0 -- Copy declarations from EXTDECS file for:
112. 012365 0 0 -- ABEND, CLOSE, DEBUG, DEFINEPOOL, DNUMIN, DNUMOUT,
FILEINFO,
113. 012365 0 0 -- GETPOOL, INITIALIZER, MYTERM, NUMIN, OPEN, PUTPOOL, READ,
114. 012365 0 0 -- READX, SQLCADISPLAY, STOP, WRITE, WRITEX, WRITEREAD,
WRITEREADX
115. 012365 0 0
116. 012365 0 0 ?NOLIST, SOURCE $SYSTEM.SYSTEM.EXTDECS (
122. 000000 0 0
123. 000000 0 0 ! Declare WHENEVER clause for warnings. The WHENEVER clause
for errors
124. 000000 0 0 ! is declared just before the MAIN procedure; the reason is
explained
125. 000000 0 0 ! with that declaration.
126. 000000 0 0 PROC sql^warning^handler; FORWARD;
127. 000000 0 0 EXEC SQL WHENEVER SQLWARNING CALL :sql^warning^handler;
128. 000000 0 0