Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

(how to handle) Oracle sqlplus & Multiple Return Paramters

Posted on 2001-08-27
2
Medium Priority
?
1,978 Views
Last Modified: 2008-03-03
Ok, I am struggling with executing the PL/SQL proc that returns not one but TWO return parameters: see below.. It is a simple syntax problem, but I havent yet found one reference to handling 'multiple' return parameters from a proc...
 
Read on...
 
The PACKAGE (or proc that needs to be called has 2 OUT params, 2 IN params)
 
PROCEDURE populate_load(
                        errbuf     OUT    VARCHAR2,
                        retcode    OUT    NUMBER,
                        p_org_id   IN     NUMBER,
                        element    IN     VARCHAR2)

So I try to execute following SQLPLUS:
 
variable    errbuf       varchar2
variable    retcode    number
 
execute :errbuf :retcode := apps.mrp_i2_erp.populate_load (errbuf,retcode,3,'set_start_date');
 
print :errbuf;
print :retcode;

I get:

Error:
Oracle8 Enterprise Edition Release 8.0.4.4.0 - Production
PL/SQL Release 8.0.4.4.0 - Production
 
begin :errbuf :retcode := apps.mrp_i2_erp.populate_load(errbuf,retcode,3,'set_start_date'); end;
                 *
ERROR at line 1:ORA-06550: line 1, column 15:
PLS-00103: Encountered the symbol "" when expecting one of the following: := . ( @ % ; indicator
The symbol ";" was substituted for "" to continue.
 
There is something wrong with the output param binding assignment in the execute statement I tried all different ways to execute the procedure to no avail, the manuals/google searches do not explain anything about multiple return parameters, one return parameter is easy..
 
Any ideas?
 
Robert.
 
0
Comment
Question by:rhbleeker
2 Comments
 
LVL 3

Accepted Solution

by:
mgokman earned 200 total points
ID: 6429488
At first, I was quite surprised by the syntax you are using. After checking SQLPlus manual, I realized where your confusion comes from. The manual gives an example with one variable and "stored procedure". This is probably an error in the manual. A stored procedure cannot be referenced in any expression. For this you need a stored function. The value assigned to your bind variable is the return value from stored function. So, you can't use this approach for two variables and you can't use stored procedure in an expression.
However, you could just list those two bind variables in your procedure arguments:
variable    errbuf       varchar2
variable    retcode    number
execute apps.mrp_i2_erp.populate_load (:errbuf,:retcode,3,'set_start_date');
print :errbuf;
print :retcode;

This works

0
 

Author Comment

by:rhbleeker
ID: 6429679
Thanks! This works.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…

782 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question