Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem while executing procedure thru Shell script (EXECUTE IMMEDIATE)

AceNoviceMay 20 2009 — edited May 21 2009
Hi All,

I have created a procedure where i am passing column name, tablename and business date. The procedure gets last 5 business date excluding Saturday and sunday based on business date.

i am using EXECUTE IMMEDIATE statement in the procedure, where i am replacing the column name, table name, and business date & then executing this statement.

stmt := 'select count(1) FROM '||tblname||' where trunc('||date_column||')= :1';

EXECUTE IMMEDIATE l_stmt into tbl_count using to_char(in_date, 'DD-MON-YYYY') ;


It will give me the count of all 5 days for a particular dates. When i run the procedure in SQL*Plus/TOAD, it gives me desired result. When i run this in UNIX shell script, it runs fine but at end gives following error:

SP-xxx: Bind varaible not declared.

Can someone tell me where might be the problem?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 18 2009
Added on May 20 2009
6 comments
591 views