Reference Guide > TDV SQL Script > SQL Script Statement Reference > BEGIN...END
 
BEGIN...END
BEGIN and END enclose a SQL Script procedure, which can include one statement or multiple statements (that is, a compound statement).
Syntax
[<label>:]
BEGIN
[<transactionSpecification>]
[<declaration>; …]
[<statement>; …]
[<exceptionBlock>]
END [<label>]
Remarks
The order of the parameters in the procedure’s declaration is important. While it is conventional to list IN, then INOUT, then OUT parameters in that order, they can be intermixed.
IN parameters are unchangeable in the procedure (like a const parameter).
OUT parameters are initialized to NULL within the procedure. Setting a value into an OUT parameter assigns the value to the variable in the caller.
INOUT parameters are like OUT parameters that are pre-initialized by the caller. Any calling environment that does not have variables should treat these parameters as if they were a pair of IN and OUT parameters.