COMPOUND STATEMENTS
This section is a translation specification for the compound statements
This section is a work in progress, information may change in the future.
Some parts in the output code are omitted for clarity reasons.
General description
The basic unit of a PL/SQL source program is the block, which groups related declarations and statements.
A PL/SQL block is defined by the keywords DECLARE, BEGIN, EXCEPTION, and END. These keywords divide the block into a declarative part, an executable part, and an exception-handling part. Only the executable part is required. (PL/SQL Anonymous Blocks)
The BEGIN...END
block in Oracle can have the following characteristics:
Be nested.
Contain the DECLARE statement for variables.
Group multiple SQL or PL/SQL statements.
Oracle syntax
Snowflake syntax
In Snowflake, a BEGIN/END block can be the top-level construct inside an anonymous block (Snowflake documentation).
Sample Source Patterns
1. IF-ELSE block
Review the following documentation about IF statements to learn more: SnowConvert IF statements translation and Snowflake IF statement documentation
Oracle
Snowflake
When calling a procedure or user-defined function (UDF), generating code is needed to support the equivalence as call_results
variable. In this case, is used to print the information.
Review the user-defined function (UDF) used here.
2. CASE statement
For more information, review the following documentation: SnowConvert CASE statement documentation and Snowflake CASE documentation
Oracle
Snowflake
When calling a procedure or user-defined function (UDF), generating code is needed to support the equivalence as call_results
variable. In this case, is used to print the information.
Review the user-defined function (UDF) used here.