Control Statements

The statements defined in the Control category are the basis for the SQL procedural language used by SQL routines. An SQL routine usually contains procedural language statements and data manipulation statements. It can also use any statement as specified by the procedure-statement syntax.
idmscu
The statements defined in the Control category are the basis for the SQL procedural language used by SQL routines. An SQL routine usually contains procedural language statements and data manipulation statements. It can also use any statement as specified by the
procedure-statement
syntax.
For more information, see CREATE PROCEDURE or CREATE FUNCTION.
The statements of the Control category include syntax to perform the following:
  • Direct the flow of control
  • Assign the result of expressions to variables and parameters
  • Specify condition handlers to process various conditions
  • Signal and resignal conditions
  • Declare local cursors
The advantages for writing SQL routines in the SQL language include:
  • Easy to read and simple but powerful programs
  • Single language to access and process data
  • Native support for all the SQL data types, which makes handling of VARCHAR, DATE, TIME, and TIMESTAMP data easier
  • Built-in NULL support avoids the burden of having to define and manipulate NULL indicators for nullable data such as table columns or parameters of SQL routines which are always nullable
  • Flexible handlers process SQL events easily
  • A single development and test platform fully integrated in all CA IDMS supported environments