DB2 stored procedure syntax (translation)

Source: Internet
Author: User
Tags savepoint

Syntax Description 1, procedure-name: The name of the stored procedure, in the same database in the same mode, there can be stored procedure name the same number of parameters of the same stored procedures, even if the parameters of different types.   2, (in | Out | INOUT parameter-name data-type,...) : Incoming parameter in: input parameter out: output parameter INOUT: As input output parameter parameter-name: Parameter name, unique identifier in this stored procedure. Data-type: A parameter type that can receive SQL types and tables created. Long VARCHAR, long vargraphic, DATALINK, reference, and user-defined types are not supported. 3, specific specific-name: unique name (alias), can be replaced with a stored procedure name, this particular name is used to Dorp stored procedures, or to add gaze to the stored procedure, but cannot call the stored procedure. If not specified, the database automatically generates a YYMMDDHHMMSSHHN timestamp name. It is recommended to give an alias. 4, DYNAMIC result sets integer: Specifies the maximum number of results that the stored procedure returns. Although there is no return statement in the stored procedure, it can return a result set. 5, CONTAINS sql, READS SQL data, modifies SQL data: Specifies the SQL access level in the stored procedure CONTAINS sql: Indicates that the stored procedure can be executed, neither read SQL     , and you cannot modify the SQL data.     READS SQL data: Indicates that the stored procedure can be executed, read SQL, but not modify the SQL. Modifies SQL DATA: Indicates that a stored procedure can execute any SQL statement. Data in the database can be added, deleted, and modified.   6, deterministic or not deterministic: Indicates that the stored procedure is dynamic or non-dynamic. The dynamic return value is indeterminate. Non-dynamic stored procedures return the same value each time the execution is performed. 7, called on NULL input: Indicates that a stored procedure can be called, regardless of whether any of the input parameters are null, and any out or inout parameter can return a NULL or non-null value. Verifying that the parameter is null is done in the process. 8, INHERIT Special Registers: represents the inheritance of private registers. 9, old savepoint level, or NEW savepoint level: establishes a storage point. The old savepoint level is the default storage point. 10. LANGUAGE sql: specifies that the body of the program is in the SQL language. 11. EXTERNAL action or no EXTERNAL action: Indicates whether the stored procedure performs some activity that alters the state of the database, not through the database Manager tube. The default is EXTERNAL ACTION. If you specify no EXTERNAL ACTION, the database determines the best optimization scenario. 12. PARAMETER CCSID: Specifies encoding of all output string data, default to Unicode encoding database PARAMETER CCSID Unicode, other database defaults to PARAMETER CCSID 3 Ascii. 13. Sql-procedure-body: the body of the stored procedure  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.