Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - SQL Reference » SQL Statements

OUTPUT statement [Interactive SQL] Next Page

PARAMETERS statement [Interactive SQL]

Use this statement to specify parameters to an Interactive SQL command file.


PARAMETERS parameter1, parameter2, ...


The PARAMETERS statement names the parameters for a command file, so that they can be referenced later in the command file.

Parameters are referenced by putting {parameter1} into the file where you want the named parameter to be substituted. There must be no spaces between the braces and the parameter name.

If a command file is invoked with less than the required number of parameters, Interactive SQL prompts for values of the missing parameters.



Side effects


See also
Standards and compatibility

The following Interactive SQL command file takes two parameters.

PARAMETERS department_id, file;
SELECT Surname
FROM Employees
WHERE DepartmentID = { department_id }

If you save this script in a file named test.sql, you can run it from Interactive SQL using the following command:

READ test.sql [100] [data]