Was this helpful?
The Create Procedure Statement
As described in the SQL Reference Guide, the create procedure statement has language-specific syntax rules for line continuation, string literal continuation, comments, and the final terminator. These syntax rules follow the rules discussed in this section. For example, there is no final terminator. Regardless of the number of statements in the procedure's body, the preprocessor treats the create procedure statement as a single statement and, as an Embedded SQL/Fortran statement, it has no final terminator. However, all statements within the body of the procedure must end with a semicolon.
The following example shows a create procedure statement that follows the Embedded SQL/Fortran syntax rules:
     exec sql
     1 create procedure proc (parm integer) as
     2 declare
     3      var integer;
     4 begin
C Use Fortran comment line
     5       if (parm > 10) then 
     6           message 'Fortran strings can continue
     7 over lines';
     8           insert into tab values (:parm);
     9       endif;
     1 end
Database procedures tend to be quite long, requiring a Fortran continuation indicator on each line. There is no limit over how many lines the create procedure statement can continue, even though the Fortran compiler may have a limit for host Fortran statements.
Last modified date: 04/03/2024