Hi all,
Pls consider the following script.
qry="'insert into rcur_test select comp_id,site_id,ebiz_appown_no from trn_vehl
og \
where comp_id=\"$1\" \
and site_id=\"$2\" \
and ebiz_appown_no=$3 \
'"
echo $qry
sqlplus -s tms/tms@dev45 <<EOF
set serveroutput on;
declare
l_cnt number;
begin
execute immediate $qry;
commit;
select count(*) into l_cnt from rcur_test;
dbms_output.put_line("l_cnt"||l_cnt);
end;
EOF
in the above script i am trying to insert the data from trn_vehlog to rcur_test
using execute immediate.I am building the query based on the parameters passed to the shell script.
The query is built correctly as follows.
'insert into rcur_test select comp_id,site_id,ebiz_appown_no from trn_vehlog where comp_id='IBM' and site_id='HYD' and ebiz_appown_no=228 '
But ,execute immediate is not insertng the data into rcur_test table.
Any idea on this.
cheers
RRK