NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
A-5
Considerations—ADD DEFINE
Considerations—ADD DEFINE
You cannot use ADD DEFINE unless the DEFMODE setting is ON. The OSS
command add_define automatically sets DEFMODE ON, but the TACL form of
ADD DEFINE does not. Before issuing a TACL ADD DEFINE command, set
DEFMODE ON.
A DEFINE stays in effect until you change it, delete it, or exit the SQLCI session in
which you created it.
Attributes you specify in an ADD DEFINE command do not become part of the
working attribute set. (See SET DEFINE Command on page S-33 for information
about changing the working attribute set.)
If the value of an attribute is a Guardian name or subvolume name, the name is
expanded immediately using the current default node, volume, and subvolume.
Examples—ADD DEFINE
The following example adds a DEFINE named =PCAT and uses it as a catalog name
in a CREATE CATALOG statement:
SET DEFMODE ON;
ADD DEFINE =PCAT, CLASS CATALOG, SUBVOL $VOL2.INVENT;
CREATE TABLE ACCOUNT
( ACCT_NO NUMERIC (9)UNSIGNED, ACCT_NAME CHAR (50) )
CATALOG =PCAT;
The following example assigns the name \SYS1.$VOL2.SALES.SALESREP to the
DEFINE named =SALES_REP_ACCOUNTS:
SET DEFMODE ON;
ADD DEFINE =SALES_REP_ACCOUNTS, CLASS MAP,
FILE \SYS1.$VOL2.SALES.SALESREP;
You can accomplish the same thing shown in the previous example by setting the
CLASS attribute in the working attribute set and then adding a DEFINE that
includes the FILE attribute. This method is especially useful when you want to
create a series of DEFINEs with the same CLASS, such as in the following:
SET DEFINE CLASS MAP ;
ADD DEFINE =SALES_REP_ACCTS, FILE $VOL2.SALES.SALESREP ;
ADD DEFINE =CUSTOMER_TABLE, FILE $VOL1.SALES.CUSTOMER ;
ADD DEFINE =ORDERS_TABLE, FILE $VOL2.SALES.ORDERS ;
ADD DEFINE =ODETAIL_TABLE, FILE $VOL3.SALES.ODETAIL ;
ADD DEFINE =PARTS_TABLE, FILE $VOL4.SALES.PARTS ;