SPL statements

These topics describe Stored Procedure Language (SPL) statements, which you use to write SPL routines. You can store these routines in the database as user-defined routines (UDRs).

SPL routines (formerly referred to as stored procedures) are effective tools for controlling SQL activity. This chapter contains descriptions of the SPL statements. The description of each statement includes the following information:
  • A brief introduction that explains the effect of the statement
  • A syntax diagram that shows how to enter the statement correctly
  • A syntax table that explains each input parameter in the syntax diagram
  • Rules of usage, including examples that illustrate these rules

If a statement is composed of multiple clauses, the statement description provides information about each clause.

For an overview of the SPL language and task-oriented information about creating and using SPL routines, see the HCL OneDB™ Guide to SQL: Tutorial.

For an overview with detailed examples of how to create and use prepared objects and Dynamic SQL in SPL routines, see this article: Dynamic SQL support in HCL OneDB Dynamic Server Stored Procedure Language.

HCL OneDB can create an SPL function with the CREATE PROCEDURE or CREATE PROCEDURE FROM statement, but requires the CREATE FUNCTION or CREATE FUNCTION FROM statement for external functions. It is recommended, however, that you use the CREATE FUNCTION or CREATE FUNCTION FROM statement to create new user-defined functions.