Using the SQL statement processor

 

The SQL statement processor allows SQL statements to be run from a source member. The statements in the source member can be run repeatedly, or changed, without compiling the source. This makes the setup of a database environment easier.

The SQL statement processor is available through the Run SQL Statements (RUNSQLSTM) command.

The statements that can be used with the SQL statement processor are:

In the source member, statements end with a semicolon and do not begin with EXEC SQL. If the record length of the source member is longer than 80, only the first 80 characters will be read. Comments in the source member can be either line comments or block comments. Line comments begin with a double hyphen (--) and end at the end of the line. Block comments start with /* and can continue across many lines until the next */ is reached. Block comments can be nested. Only SQL statements and comments are allowed in the source file. The output listing and the resulting messages for the SQL statements are sent to a print file. The default print file is QSYSPRT.

To perform syntax checking only on all statements in the source member, specify the PROCESS(*SYN) parameter on the RUNSQLSTM command.

 

Parent topic:

Using SQL in different environments

 

Related reference


Run SQL Statement (RUNSQLSTM) command