Reads Interactive SQL (dbisql) statements from a file.
READ [ ENCODING encoding ] filename [ parameter ] …
If filename does not contain an absolute path, Interactive SQL searches for the file. The location of filename is determined based on the location of the READ statement, as follows:
Parameter names must be enclosed in square brackets. 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 script file can be identifiers, numbers, quoted identifiers, or strings. When quotes are used around a parameter, the quotes are put into the text during the substitution. Parameters that are not identifiers, numbers, or strings (contain spaces or tabs) must be enclosed in square brackets ([ ]). This allows for arbitrary textual substitution in the script file.
If not enough parameters are passed to the script file, Interactive SQL prompts for values for the missing parameters.
When executing a reload.sql file with Interactive SQL, you must specify the encryption key as a parameter. If you do not provide the key in the READ statement, Interactive SQL prompts for the key.
READ status.rpt '160'
READ birthday.sql [>= '1988-1-1'] [<= '1988-1-30']
[test1.sql] PARAMETERS par1, par2; BEGIN DECLARE v_par1 int; DECLARE v_par2 varchar(200) SET v_par1 = {par1}; SET v_par2 = {par2}; MESSAGE STRING('PAR1 Value: ', v_par1 ) TO CLIENT; MESSAGE STRING('PAR2 Value: ', v_par2 ) TO CLIENT; END;
(USR1)> READ test1.sql 123 '041028' PAR1 Value: 123 PAR2 Value: 041028