SQL Programming Manual for TAL
Examples of Dynamic NonStop SQL Programs
HP NonStop SQL Programming Manual for TAL—527887-001
C-16
Detailed Dynamic SQL Program
Page 5 [1] $VOL1.S04.TALDYN 1991-10-15 13:42:28
Output formatting stuff
130. 000000 0 0 !
131. 000000 0 0 ! Here are a few DEFINEs to make it a little easier to format
132. 000000 0 0 ! and print messages.
133. 000000 0 0 !
134. 000000 0 0 ! put a string into the line, starting at beginning of the
line
135. 000000 0 0 DEFINE PUT^STR (s) = @next^buf := @sbuf;
136. 000000 0 0 next^buf ':=' s -> @next^buf #;
137. 000000 0 0
138. 000000 0 0 ! put a string into the line, starting after the beginning
139. 000000 0 0 DEFINE PUT^STR^MID (s) = next^buf ':=' s -> @next^buf #;
140. 000000 0 0
141. 000000 0 0 ! put an integer into the line
142. 000000 0 0 DEFINE PUT^INT (n) = @next^buf := @sbuf;
143. 000000 0 0 @next^buf := @next^buf +
144. 000000 0 0 $DBL(DNUMOUT(next^buf,$DBL(n),10)) #;
145. 000000 0 0
146. 000000 0 0 ! put an integer into the line, starting after the
beginning
147. 000000 0 0 DEFINE PUT^INT^MID (n)= @next^buf := @next^buf +
148. 000000 0 0 $DBL(DNUMOUT(next^buf,$DBL(n),10)) #;
149. 000000 0 0
150. 000000 0 0 ! put an INT(32) into the line
151. 000000 0 0 DEFINE PUT^DBL (n) = @next^buf := @sbuf;
152. 000000 0 0 @next^buf := @next^buf +
153. 000000 0 0 $DBL(DNUMOUT(next^buf,n,10)) #;
154. 000000 0 0
155. 000000 0 0 ! put an INT(32) into the line, starting after the
beginning
156. 000000 0 0 DEFINE PUT^DBL^MID (n) = @next^buf := @next^buf +
157. 000000 0 0 $DBL(DNUMOUT(next^buf,n,10)) #;
158. 000000 0 0
159. 000000 0 0 ! print the line
160. 000000 0 0 DEFINE PRINT^LINE = call WRITE(term,buf,$INT(@next^buf -
@sbuf)) #;
161. 000000 0 0
162. 000000 0 0 ! print a blank line
163. 000000 0 0 DEFINE PRINT^BLANK^LINE = call WRITE(term,buf,0) #;
164. 000000 0 0
165. 000000 0 0