[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Oracle - Pass Parameters from shell script to stored procedures

Posted on 2007-07-26
2
Medium Priority
?
2,563 Views
Last Modified: 2013-12-19
I am producing two parameters from a webpage (jsp,java) and am sending them to a shell script.

I want to call them in a stored procedure from the shell script as below:
                  sqlplus $USERNAME @/opt/sql/removehols_sql $1 $2    <---- calling params correctly?

The "removehols_sql" then calls the actual procedure that utilises the parameters:
                 call full_removehols();             <---------- how do I pass the parameters from "removehols_sql"?

If I hardcode in parameters it works fine
                 call full_removehols('TYPE1','13-07-2007');

can somebody please tell me how I can pass the parameters through corectly as this is quite urgent.
Thanks.
0
Comment
Question by:davystocks
2 Comments
 
LVL 8

Accepted Solution

by:
YANN0S earned 2000 total points
ID: 19573041
Within your sql script you should have:
call full_removehols('&1', '&2');

and then call
sqlplus $USERNAME @/opt/sql/removehols_sql TYPE1 13-07-2007

Note that you should include &1 within single quotes. That is needed if $1 equals TYPE1. If $1equals 'TYPE1' (ie quotes are included) then you should remove them from the script.
0
 
LVL 4

Author Comment

by:davystocks
ID: 19573148
Perfect. Thanks for your prompt and accurate response YANN0S
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

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

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
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.
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 videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Suggested Courses

867 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