Previous Topic: Restrictions for Cursor OperationsNext Topic: How the Environment Determines Which Statements Are Permitted


Formats for Invoking SQL Statements

To invoke an SQL statement from a TSO terminal, a TSO/E REXX program, or a TSO CLIST, CA OPS/MVS provides the OPSQL command processor. The SQL statement has a maximum length of 2048 characters.

Use this format for OPSQL:

OPSQL sqlstatement

Note: Although the abbreviation SQL is an alias of the OPSQL command processor, we strongly recommend that you specify the complete text of the command. Doing so prevents confusion that can occur with other products having SQL command processors.

To invoke an SQL statement from an AOF rule (running under the production or the test facility) or an OPS/REXX program, CA OPS/MVS provides the ADDRESS SQL host environment. Use this format for ADDRESS SQL:

ADDRESS SQL
  "sqlstatement"

Diagrams that show the detailed syntax of each SQL statement (for example, ALTER TABLE, CREATE TABLE, and so on) appear later in this chapter. For a list of statements, see List of SQL Statements in this chapter.