Oracle - Pass Parameters from shell script to stored procedures

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.
LVL 4
davystocksAsked:
Who is Participating?
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.

 
YANN0SCommented:
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

Experts Exchange Solution brought to you by ConnectWise

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
 
davystocksAuthor Commented:
Perfect. Thanks for your prompt and accurate response YANN0S
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.