Previous Topic: CREATE INDEX StatementNext Topic: Proc-Body Syntax


CREATE PROCEDURE Statement

                                      ┌─ , ──────────────────────┐
►►─ CREATE PROCEDURE proc-name ─── ( ─▼─┬──────────────────────┬─┴─ ) ────────►
                                        ├─┬─ IN ◄ ──┬──────────┤
                                        │ ├─ OUT ───┤          │
                                        │ └─ INOUT ─┘          │
                                        ├─ SQL-parameter-name ─┤
                                        └─ datatype ───────────┘

 ►─┬─────────────────┬─ proc-body ────────────────────────────────────────────►
   └┤proc-attributes├┘

 ►─┬────────────────────────────────────┬─────────────────────────────────────►◄
   └─ RUN OPTIONS ─ run-options-string ─┘

Expansion of proc-attributes

   ┌──────────────────────────────┐
├──▼─┬┤language├────────────────┬─┴────────────────────────────────────────────┤
     ├┤parameter-style├─────────┤
     ├─ SPECIFIC name ──────────┤
     ├─┬───────┬ DETERMINISTIC ─┤
     │ └─ NOT ─┘                │
     └┤data-access├─────────────┘

Expansion of language

├── LANGUAGE ─┬─ COBOL ─────┬──────────────────────────────────────────────────┤
              ├─ PLI ───────┤
              ├─ C ─────────┤
              ├─ ASSEMBLER ─┤
              └─ SQL ───────┘

Expansion of parameter-style

├── PARAMETER STYLE ─┬─ GENERAL ────────────┬──────────────────────────────────┤
                     ├─ GENERAL WITH NULLS ─┤
                     ├─ DATACOM SQL ────────┤
                     └─ SQL ────────────────┘

Expansion of data-access

├──┬─ MODIFIES SQL DATA ─┬─────────────────────────────────────────────────────┤
   ├─ READS SQL DATA ────┤
   ├─ CONTAINS SQL ──────┤
   └─ NO SQL ────────────┘

SQL-parameter-name is required for SQL Procedures and, though optional for all others, is recommended for all others as well.

See the separate proc-body syntax diagram that follows.

All of the proc-attributes choices can be used together, but each can only be used once. If you are using SQL Procedures, data-access and parameter-style do not apply.

You can specify the parameter-style only once, either here as part of the procedure attribute syntax or as part of the EXTERNAL syntax. Parameter-style applies only to External Procedures. It does not apply to SQL Procedures. For details, see the CA Datacom/DB SQL User Guide.

For LANGUAGE keyword, SQL applies to SQL Procedures. The other choices apply to External Procedures.