SQL/MP Reference Manual
HP NonStop SQL/MP Reference Manual—523352-013
O-3
Examples—OBEY
If BREAK_KEY is OFF, pressing the Break key interrupts execution and passes
control to the previous Break key owner, usually TACL. From TACL, enter PAUSE
to resume or STOP to terminate SQLCI.
Examples—OBEY
This example shows the contents of a simple command file that sets DEFINE
values:
SET DEFMODE ON;
ADD DEFINE =REP, FILE \SYS1.$VOL2.SALES.SALESREP;
ADD DEFINE =CUST, FILE \SYS1.$VOL2.SALES.CUSTOMER;
ADD DEFINE =ORD, FILE \SYS1.$VOL2.SALES.ORDERS;
If the commands are in a file named DEFS, you can execute them from SQLCI by
typing,
OBEY DEFS;
This example shows a command file that uses both sections and parameters. The
example also shows the SQLCI output when OBEY executes a short section from
a command file.
The contents of UPDOP the command file are:
?SECTION NEWJOB
UPDATE PERSNL.EMPLOYEE
SET JOBCODE=?JCOD WHERE EMPNUM=?EMPN;
?SECTION NEWSAL
...
?SECTION NEWDEPT
...
This example executes section NEWJOB from the command file. The first two
commands (SET PARAM and OBEY) are entered by the user; everything else is
printed by SQLCI, echoing and responding to commands from the file as it
executes them.
>>SET PARAM ?EMPN 557, ?JCOD 500;
>>OBEY UPDOP (NEWJOB);
>>?SECTION NEWJOB
>>UPDATE PERSNL.EMPLOYEE
+> SET JOBCODE = ?JCOD WHERE EMPNUM = ?EMPN;
--- 1 row(s) updated.