oracle--Stored Procedure Parameters

Source: Internet
Author: User

Oracle Stored Procedure type:

1, in: The input type, that is, the application passes data into the Oracle stored procedure, this parameter is read-only parameter in the stored procedure, cannot modify the parameter of the type in the stored procedure;

2, out: The output parameter, is in the stored procedure to assign the value, obtains the value in the program.

3, in out: input and output parameters, both of the above characteristics, but readable and writable.

Verify input parameters:

Because the default parameter is the input type, in, the Bacount parameter is assigned a value, error.

Workaround:

CREATE OR REPLACEPackage Body BAWQ_PROC_JGZX isPROCEDUREproc_csjgzx (PprocVARCHAR2, Bacountint:=3) isIint:=Bacount;--define variables, replace parameters with variablesBEGINI:=Bacount;dbms_output.put_line (i); Deletecsjgzx;  whileI>0LOOP I:=I-1 ; Insert  intoCSJGZX (Csjgzx_proc,id,bh,mc,data)Values(Pproc,sys_guid (), Sys_guid (),'Jinan',cast(Dbms_random. VALUE (1, $) as int)); Commit; EndLoop;ENDproc_csjgzx;ENDBAWQ_PROC_JGZX;

In short, in is the message that is passed to the stored procedure when the stored procedure is called. Out is a message that the stored procedure is outgoing from the caller. In-out is the communication between the two.

oracle--Stored Procedure Parameters

Related Article

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.