The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Unix Arithmatic operation issue , datatype issue thambi Shell Programming and Scripting 23 02-19-2008 04:19 AM
awk and execute app tyger52 Shell Programming and Scripting 0 12-06-2007 06:43 PM
execute bkan77 Shell Programming and Scripting 3 07-20-2007 10:42 AM
script execute or no execute Kespinoza97 Shell Programming and Scripting 4 06-23-2007 06:27 AM
Need to execute 2 scripts, wait, execute 2 more wait, till end of file halo98 Shell Programming and Scripting 1 08-01-2006 01:42 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 03-19-2008
Registered User
 

Join Date: Dec 2006
Location: hyderabad
Posts: 102
execute immediate issue

Hi all,
Pls consider the following script.
Code:
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.

Code:
'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

Last edited by Yogesh Sawant; 03-19-2008 at 12:53 AM. Reason: added code tags
Reply With Quote
Google The UNIX and Linux Forums
Forum Sponsor
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 06:07 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0