HP (Hewlett-Packard) 544530-001 Computer Accessories User Manual


 
Setting Parameters
In a Neoview session, you can set a parameter of an SQL statement (either prepared or not) by
using the SET PARAM command.
NOTE: The parameter name is case-sensitive. If you specify it in lowercase in the SET PARAM
command, you must specify it in lowercase in other statements, such as DML statements or
EXECUTE.
For example, this SET PARAM command sets a value for the parameter named ?sal, which
you can apply to one of the unnamed parameters in the prepared findemp statement or to a
named parameter with an identical name in an SQL statement:
SQL>set param ?sal 40000.00
This SELECT statement uses sal as a named parameter:
SQL>select last_name
+>from persnl.employee
+>where salary = ?sal;
This SET PARAM command sets a value for the parameter named dn, which you can apply to
the named parameter, ?dn, in the prepared empcom statement or to a named parameter with an
identical name in an SQL statement:
SQL>set param ?dn 1500
For the syntax of the SET PARAM command, see the “SET PARAM Command” (page 107).
Displaying the Parameters of the Session
To determine what parameters you have set in the current session, use the SHOW PARAM
command. For example, this SHOW PARAM command displays the recent SET PARAM settings:
SQL>show param
dn 1500
sal 40000.00
SQL>
For the syntax of the SHOW PARAM command, see the “SHOW PARAM Command” (page 118).
Resetting the Parameters
To change the value of a parameter, specify the name of the parameter in the RESET PARAM
command and then use the SET PARAM command to change the setting. For example, suppose
that you want to change the salary parameter to 80000.00:
SQL>reset param ?sal
SQL>set param ?sal 80000.00
SQL>
Entering the RESET PARAM command without specifying a parameter name clears all parameter
settings in the session. For example:
SQL>reset param
SQL>show param
SQL>
To use the parameters that you had set before, you must reenter them in the session:
SQL>set param ?dn 1500
SQL>set param ?sal 80000.00
SQL>show param
Running SQL Statements 61