passing one parameter from Shell-script to Sql-script [message #269235] |
Fri, 21 September 2007 05:22 |
subodhbansal
Messages: 2 Registered: September 2007
|
Junior Member |
|
|
Dear Friends,
Please help me to achieve the following:
I want to pass one parameter from Shell-script to Sql-script.
Example:
My ShellScript.sh is calling report.sql like this:
/bin/sqlplus /reports.sql
And
My report.sql is calling many Stored-Procedures like this:
exec SP_REPORT_1( TO_DATE('20070921', 'YYYYMMDD') );
exec SP_REPORT_2( TO_DATE('20070921', 'YYYYMMDD') );
exec SP_REPORT_2( TO_DATE('20070921', 'YYYYMMDD') );
So I want to passs this date ('20070921') from ShellScript.sh to report.sql, somthing like this:
/bin/sqlplus /reports.sql '20070921'
Please tell me how can I achieving this, I am very poor in Shell and SQL scripting.
Many Thanks,
Subodh Bansal
|
|
|
|
Re: passing one parameter from Shell-script to Sql-script [message #269259 is a reply to message #269244] |
Fri, 21 September 2007 06:49 |
subodhbansal
Messages: 2 Registered: September 2007
|
Junior Member |
|
|
Thanks Michel,
Actually calling sql-scripts from my shell-script works without any problem. This works without any problem.
Like this:
/u01/oracle/9.2.0/bin/sqlplus user/pass @/reports/rbt_reports.sql
But I want to pass a param (date value) to Sql-script.
You tried to explain me but as I have little understanding about scripting stuff, would you Please explain me in little bit more detail with example.
I will really appreciate your help.
Thanks,
Subodh
|
|
|
|
|