Neoview Command Interface (NCI) Guide (R2.5)
Considerations
• You must enter the command on one line. The command does not require an SQL terminator.
• You can execute this command only in SQL mode.
• Use separate SET PARAM commands to name and assign values to each unique parameter
in a prepared SQL statement before running the EXECUTE statement.
• Parameter names are case-sensitive. If you specify a parameter name in lowercase in the
SET PARAM command, you must specify it in lowercase in other statements, such as DML
statements or EXECUTE.
• The name of a named parameter (?param-name) in a DML statement must be identical to
the parameter name (param-name) that you specify in a SET PARAM command.
Examples
• This command sets a value for the ?sal (salary) parameter:
SQL>set param ?sal 40000.00
• This command sets a character string value, GREEN, for the ?lastname parameter:
SQL>set param ?lastname GREEN
• These commands set values for named parameters in a subsequent SELECT statement:
SQL>set param ?sal 80000.00
SQL>set param ?job 100
SQL>select * from persnl.employee
where salary = ?sal
and jobcode = ?job;
EMPNUM FIRST_NAME LAST_NAME DEPTNUM JOBCODE SALARY
------ --------------- -------------------- ------- ------- ----------
72 GLENN THOMAS 3300 100 80000.00
--- 1 row(s) selected.
SQL>
NOTE: The names of the named parameters, ?sal and ?job, in the SELECT statement
are identical to the parameter names, sal and job, in the SET PARAM command.
For more information, see “Setting Parameters” (page 55).
SET PROMPT Command
The SET PROMPT command sets the prompt of the current session to a specified string and/or
to the session variables, which start with %. In SQL mode, the default prompt is SQL>. In CS
mode, the default prompt is CS#.
Syntax
SET PROMPT [string] [%USER] [%ROLE] [%MODE] [%SERVER]
[%SCHEMA] [%DATASOURCE]
string
is a string value to be displayed as the prompt. The string may contain any characters. Spaces
are allowed if you enclose the string in double quotes. If you do not enclose the string in
double quotes, the prompt is displayed in uppercase.
%USER
displays the session user name as the prompt.
118 NCI Commands