Neoview Command Interface (NCI) Guide (R2.5)
SQL> INVOKE Employees
SQL> -- ERROR 4082 means the table does not exist
SQL> IF ERRORCODE != 4082 THEN GOTO BeginPrepare
SQL> CREATE TABLE Employees(SSN INT PRIMARY KEY NOT NULL NOT DROPPABLE, FName
VARCHAR(50),
LName VARCHAR(50), HireDate DATE DEFAULT CURRENT_DATE);
SQL> LABEL BeginPrepare
SQL> PREPARE empSelect FROM
+> SELECT * FROM
+> Employees
+> WHERE SSN=?empSSN;
SQL> IF USER == “alice” THEN SET PARAM ?empSSN 987654321;
SQL> IF %USER == “bob” THEN SET PARAM ?empSSN 123456789;
SQL> execute empSelect
SQL> IF USER == “alice” THEN
+> IF ACTIVITYCOUNT == 0 THEN GOTO insertAlice;
SQL> IF USER == “bob” THEN IF ACTIVITYCOUNT == 0 THEN GOTO insertBob;
SQL> EXIT
SQL> LABEL insertAlice
SQL> INSERT INTO Employees(SSN, FName, LName) VALUES(987654321, 'Alice',
'Smith');
SQL> EXIT
SQL> LABEL insertBob
SQL> INSERT INTO Employees(SSN, FName, LName) VALUES(123456789, 'Bob',
'Smith');
SQL> EXIT
LABEL Command
The LABEL command marks a point in the command history that you can jump to by using the
GOTO command. For more information, see the “GOTO Command” (page 88).
Syntax
LABEL {label}
label
is a string of characters without quotes and spaces, or a quoted string.
Considerations
You must enter the command on one line.
Examples
This command creates a label using a string of characters:
SQL> LABEL MyNewLabel
This command creates a label using a quoted string:
SQL> LABEL "Neoview Label"
LABEL Command 91