SQL Programming Manual for TAL
Examples of Dynamic NonStop SQL Programs
HP NonStop SQL Programming Manual for TAL—527887-001
C-23
Detailed Dynamic SQL Program
Page 12 [1] $VOL1.S04.TALDYN 1991-10-15 13:42:28
request^invars
462. 001257 1 3 _SQLDT_INT_Y_Y .. _SQLDT_INT_D_F ->
463. 001260 1 3 PUT^STR ("Please enter a date/time interval");
464. 001276 1 3 if namelen then
465. 001302 1 3 begin
466. 001302 1 4 PUT^STR^MID (" for " & param^name for namelen);
467. 001323 1 4 end;
468. 001323 1 3 PUT^STR^MID (": ");
469. 001337 1 3 PRINT^LINE;
470. 001352 1 3 param^.v^datetime ':=' " " & param^.v^datetime
471. 001352 1 3 for $OCCURS(param^.v^datetime)-1;
472. 001370 1 3 call READX(term,param^.v^datetime,$OCCURS
(param^.v^datetime));
473. 001401 1 3
474. 001401 1 3 IF (sqlda.sqlvar[i].null^info = -1) AND
475. 001401 1 3 (param^.v^datetime = "?") THEN
476. 001421 1 3 begin ! got a null value; set null indicator
477. 001421 1 4 @ind^ := sqlda.sqlvar[i].ind^ptr;
478. 001434 1 4 ind^ := -1;
479. 001437 1 4 end;
480. 001437 1 3
481. 001437 1 3 OTHERWISE ->
482. 001440 1 3 PUT^STR ("This data type is not supported: ");
483. 001456 1 3 PUT^INT^MID(sqlda.sqlvar[i].data^type);
484. 001507 1 3 PRINT^LINE;
485. 001522 1 3 END; !end of case
486. 002063 1 2
487. 002063 1 2 END; !for
488. 002072 1 1
489. 002072 1 1 return 0;
490. 002074 1 1 END; ! end of proc request^invars
491. 000000 0 0
492. 000000 0 0
493. 000000 0 0