Solved

(how to handle) Oracle sqlplus & Multiple Return Paramters

Posted on 2001-08-27
2
1,952 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Suggested Solutions

Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

738 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