FirebirdSQL logo
 PROCEDUREEXTERNAL FUNCTION 

Variable, Cursor and Subroutine Declarations

The optional declarations section, located at the start of the body of the function definition, defines variables (including cursors) and subroutines local to the function.Local variable declarations follow the same rules as parameters regarding specification of the data type.See details in the PSQL chapter for DECLARE VARIABLE, DECLARE CURSOR, DECLARE FUNCTION, and DECLARE PROCEDURE.

Function Body

The header section is followed by the function body, consisting of one or more PSQL statements enclosed between the outer keywords BEGIN and END.Multiple BEGIN …​ END blocks of terminated statements may be embedded inside the procedure body.