Was this helpful?
The Create Procedure Statement
The create procedure statement, according to the SQL Reference Guide, has language‑specific syntax rules for line continuation, string literal continuation, comments, and the final terminator. These syntax rules follow the rules this section discusses — for example, the final terminator is end-exec. Regardless of the number of statements inside the procedure body, the preprocessor treats the create procedure statement as a single statement, and, when you use it as an embedded SQL/COBOL statement, you must use end-exec to terminate it. In addition, terminate all statements within the body of the procedure with a semicolon.
The following example shows a create procedure statement that follows the embedded SQL/COBOL syntax rules:
            var INTEGER;
* COBOL comment line
      IF parm > 10 THEN
      MESSAGE 'COBOL strings can continue (use hyphen)
-        ' over lines';
      INSERT INTO tab VALUES (:parm);
Last modified date: 06/10/2024