SQL/MP Reference Manual

HP NonStop SQL/MP Reference Manual523352-013
A-5
Considerations—ADD DEFINE
Setting the CLASS attribute establishes a new set of attributes for the DEFINE and
sets each attribute associated with that CLASS to its initial value. If you specify
CLASS after you specify other attributes, the values you specified for the previous
attributes are erased.
For more information about DEFINE attributes, see DEFINEs on page D-27.
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. For information about changing the working attribute set, see
SET DEFINE Command on page S-32.
If the value of an attribute is a Guardian name or a subvolume name, the name is
expanded immediately using the current default node, the volume, and the
subvolume.
Examples—ADD DEFINE
This 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;
This 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 result shown in the previous example by setting the
CLASS attribute in the working attribute set and 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:
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 ;