An example of a command file that would take a parameter is a command file to show the department an employee belongs to, providing the employee's name as a parameter.
The PARAMETERS command is used to give names to the parameters passed to a command file. In this case, we are giving the first parameter the name employee_name. The parameters are then used in the rest of the command file by enclosing them in braces ({}). Save the command file to emp_dept.sql.
% This command file has one parameter
parameters employee_name;
select emp_lname, dept_name
from employee
NATURAL JOIN department
where emp_lname = {employee_name};
READ emp_dept.sql
'Whitney'
You should now see that the employee with surname Whitney is in the R&D department.
Parameters can also be specified on the READ command. Try the following command:
READ emp_dept.sql 'whitney'
In this case you have specified the parameter on the READ command, so ISQL will not prompt for it. ISQL will only prompt for parameters that are named in the PARAMETERS command but are not supplied on the READ command.