Reads Interactive SQL statements from a file.
read [ encoding {identifier | string}] file_name [ parameters ]
identifier – is the identifier you are using to indicate the file you are reading.
string – is the string you are using to indicate the file you are reading.
READ status.rpt '160' READ birthday.SQL [>= '1988-1-1'] [<= '1988-1-30']
The read statement reads a sequence of Interactive SQL statements from the named file. This file can contain any valid Interactive SQL statement, including other read statements. read statements can be nested to any depth. If the file name does not contain an absolute path, Interactive SQL searches for the file. Interactive SQL first searches the current directory, and then the directories specified in the environment variable SQLPATH, and then the directories specified in the environment variable PATH. If the named file has no file extension, Interactive SQL searches each directory for the same file name with the extension .SQL.
The code page specified with the default_isql_encoding option (if this option is set)
The code page specified with the -codepage option when Interactive SQL was started
The default code page for the computer Interactive SQL is running on
Parameters can be listed after the name of the command file. These parameters correspond to the parameters named on the parameters statement at the beginning of the statement file. Interactive SQL substitutes the corresponding parameter wherever the source file contains {parameter_name}, where parameter_name is the name of the appropriate parameter.
The parameters passed to a command file can be identifiers, numbers, quoted identifiers, or strings. When quotes are used around a parameter, the quotes are placed into the text during the substitution. You must enclose in square brackets ([ ]) parameters that are not identifiers, numbers, or strings (contain spaces or tabs). This allows for arbitrary textual substitution in the command file.
If not enough parameters are passed to the command file, Interactive SQL prompts for values for the missing parameters.
Any user can execute this command.