Previous Topic: SPOOLRECIPIENT Statement—Specify SAP Spool RecipientNext Topic: SQL_COMMAND Statement—Specify SQL to Run Against a Database Table


SQL Statement—Specify SQL to Run Against a Database Table

The SQL statement specifies an SQL statement to run against a database table.

Supported Job Type

This statement is required for the SQL job type.

Syntax

This statement has the following format:

SQL sql_statement
sql_statement

Specifies the SQL statement to run against a database table.

Limits: Up to 4078 characters; case-sensitive

Example: 'SELECT store FROM store_info WHERE sales > 1000'

Note: The value can contain any SQL statement including SELECT, DELETE, UPDATE or INSERT.

Notes:

Example: Run an SQL Query

In the following SQL job, the agent CYBDB1 runs the SQL query 'SELECT store FROM store_info WHERE sales > 1000':

AGENT CYBDB1
SQL 'SELECT store FROM store_info WHERE sales > 1000'