SQL Programming Manual for Pascal

Examples of Static NonStop SQL Programs
HP NonStop SQL Programming Manual for Pascal528614-001
B-2
Insertion Program
The source file name is NEWPART and the object file name is POBJ.
Tandem Pascal (T9256C30 01DEC90)
COPYRIGHT TANDEM COMPUTERS INCORPORATED 1986,1987,1988,1989
1 0 ?SYMBOLS
2 0 ?SQL NOWHENEVERLIST
3 0
4 0 PROGRAM NEWPART (input, output);
5 0
6 0 IMPORT BEGIN
7 0 ?SOURCE $system.system.pextdecs, nolist
...
8 0 ?SOURCE $system.system.pasext, nolist
...
9 0 END;
10 0
11 0 {* TYPE DECLARATIONS: *}
12 0
13 0 {* Input data record: *}
14 0
15 0 TYPE
16 0 IN_DATA_TYPE = RECORD
17 1 IN_PARTNUM : INTEGER;
18 1 IN_LOC_CODE : FSTRING[3];
19 1 IN_PRICE : INT32;
20 1 IN_PARTDESC : FSTRING[18];
21 1 IN_QTY : INT32;
22 1 END;
23 0
24 0 {* Type declarations for host variables: *}
25 0
26 0 EXEC SQL BEGIN DECLARE SECTION;
27 0
28 0 EXEC SQL INVOKE =PARTS AS PARTS_TYPE;
1 0 {* Record Definition for table \SYS.$VOL.SDB.PARTS *}
2 0 {* Definition current at 14:39:07 - 08/23/91 *}
3 0 type
4 0 parts_type = record
5 1 partnum : cardinal;
6 1 partdesc : fstring(18);
7 1 price : int32; {* scale is 2 *}
8 1 qty_available : int32;
9 1 END;
29 0 EXEC SQL INVOKE =SUPPLIER AS SUPPLIER_TYPE;
1 0 {* Record Definition for table \SYS.$VOL.SDB.SUPPLIER *}
2 0 {* Definition current at 14:39:09 - 08/23/91 *}
3 0 type
4 0 supplier_type = record
5 1 suppnum : cardinal;
6 1 suppname : fstring(18);
7 1 street : fstring(22);
8 1 city : fstring(14);
9 1 state : fstring(12);
10 1 postcode : fstring(10);
11 1 END;
30 0 EXEC SQL INVOKE =PARTLOC AS PARTLOC_TYPE;
1 0 {* Record Definition for table \SYS.$VOL.SDB.PARTLOC *}
2 0 {* Definition current at 14:39:10 - 08/23/91 *}
3 0 type
4 0 partloc_type = record
5 1 loc_code : fstring(3);
6 1 partnum : cardinal;
7 1 qty_on_hand : int32;
8 1 END;