oracle get many out params from procedures

Hi,

Reference to post: http://www.experts-exchange.com/Database/Oracle/Q_28605273.html
Solution id:ID: 40575654

If i have 2 out parameters ,how can i get them both in my shell variables.

Thanks
LVL 5
magentoAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Alex [***Alex140181***]Software DeveloperCommented:
Did you try?!

Result=`sqlplus -s userid/passwd <<EOSQL
var var1 number;
exec myProc( :var1 out number, :var2 out number);
print :var1
print :var2
exit
EOSQL`

Open in new window

0
magentoAuthor Commented:
So both the out parameters will be stored in variable $Result?
0
Alex [***Alex140181***]Software DeveloperCommented:
Here's my little test setup for your issue:
[oracle@ora12c ~]$ cat proc_out_test.sh
Result=`sqlplus -s user/password <<EOSQL
alter session set container = pdborcl1;
var var1 number;
var var2 number;
exec myproc(:var1, :var2);
print :var1
print :var2
exit
EOSQL`
echo $Result
[oracle@ora12c ~]$ ./proc_out_test.sh 
Session altered. PL/SQL procedure successfully completed. VAR1 ---------- 1 VAR2 ---------- 2
[oracle@ora12c ~]$ 

Open in new window


I suppose you're NOT using 12c yet, so leave out the "alter session set container = pdborcl1;" and adjust your login...
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
magentoAuthor Commented:
Its works fine for me . Thanks for your help.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.