Problem while executing procedure thru Shell script (EXECUTE IMMEDIATE)
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?