Solved

(how to handle) Oracle sqlplus & Multiple Return Paramters

Posted on 2001-08-27
2
1,941 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 50 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
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 how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

830 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