SQL/MP Installation and Management Guide

Managing Database Applications
HP NonStop SQL/MP Installation and Management Guide523353-004
10-34
Using DEFINEs From SQLCI
This example uses a logical name to identify a COBOL library. The logical name is
resolved only at preprocess time when the associated information is copied into the
program.
EXEC SQL BEGIN DECLARE SECTION END-EXEC.
EXEC SQL
SOURCE =COPYLIB(DEPT, JOB) END-EXEC.
EXEC SQL END DECLARE SECTION END-EXEC.
Using DEFINEs From SQLCI
These examples illustrate the use of DEFINEs with SQLCI.
These commands first set the DEFMODE option to ON and then create DEFINEs in an
SQLCI session:
>> SET DEFMODE ON;
>> ADD DEFINE =AR_CATALOG, CLASS CATALOG,
+> SUBVOL \SYS1.$VOL.ARCAT;
>> ADD DEFINE =EMPLOYEE, CLASS MAP,
+> FILE \SYS1.$VOL1.PERSNL.EMPS;
>> ADD DEFINE =MGR_PROTECTION_VIEW, CLASS MAP,
+> FILE \SYS1.$VOL1.PERSNL.EMPSP1;
>> ADD DEFINE =PR_CATALOG, LIKE =AR_CATALOG,
+> SUBVOL \SYS1.$VOL.PRCAT;
These commands alter DEFINEs in an SQLCI session:
>> ALTER DEFINE =AR_CATALOG, SUBVOL \SYS1.$NEWVOL.ARCAT;
>> ALTER DEFINE =EMPLOYEE, FILE \SYS1.$NEWVOL.PERSNL.EMPS;
These commands delete DEFINEs in an SQLCI session:
>> DELETE DEFINE =AR_CATALOG;
>> DELETE DEFINE (=EMPLOYEE,=MGR_PROTECTION_VIEW);
These commands alter the =_DEFAULTS DEFINE in an SQLCI session:
>> VOLUME \SYS1.$VOL1.PERSNL;
>> CATALOG \SYS1.$VOL1.PERSNL;
You can also use an ALTER DEFINE command to alter the =_DEFAULTS DEFINE as
shown:
>> ALTER DEFINE =_DEFAULTS, CATALOG \SYS1.$VOL1.SALES;
This example uses DEFINEs in the CREATE TABLE statement to identify the table and
catalog. Suppose that the DEFINEs were previously added as shown in the preceding
examples: