SQL Programming Manual for Pascal

Sample NonStop SQL Database
HP NonStop SQL Programming Manual for Pascal528614-001
A-2
Sample Database Source File
Sample Database Source File
A source file for the database was created using INVOKE commands executed from
SQLCI. For example, the INVOKE command for the DEPT table is:
>>INVOKE PERSNL.DEPT FORMAT PASCAL TO SRCFILE (DEPT) ;
Figure A-2 shows the source file containing the record descriptions of database tables.
Figure A-2. Sample Database Source File (page 1 of 4)
{* *}
{* Personnel (PERSNL) *}
{* *}
{* *}
? SECTION EMPLOYEE
{* Record Definition for \SYS1.$VOL1.PERSNL.EMPLOYEE *}
{* Definition current at 09:54:33 - 12/11/91 *}
type
employee_type = record
empnum : cardinal;
first_name : fstring(15);
last_name : fstring(20);
deptnum : cardinal;
jobcode : cardinal;
salary : int32; {* scale is 2 *}
END;
?SECTION DEPT
{* Record Definition for \SYS1.$VOL1.PERSNL.DEPT *}
{* Definition current at 09:54:35 - 12/11/91 *}
type
dept_type = record
deptnum : cardinal;
deptname : fstring(12);
manager : cardinal;
rptdept : cardinal;
location : string(18);
END;
?SECTION JOB
{* Record Definition for \SYS1.$VOL1.PERSNL.JOB *}
{* Definition current at 09:54:37 - 12/11/91 *}
type
job_type = record
jobcode : cardinal;
jobdesc : string(18);
VSTA02.vsd