execute immediate issue


 
Thread Tools Search this Thread
Top Forums Programming execute immediate issue
# 1  
Old 03-19-2008
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 04:53 AM.. Reason: added code tags
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Variable value substitution issue with awk command issue

Hi All, I am using the below script which has awk command, but it is not returing the expected result. can some pls help me to correct the command. The below script sample.ksh should give the result if the value of last 4 digits in the variable NM matches with the variable value DAT. The... (7 Replies)
Discussion started by: G.K.K
7 Replies

2. Shell Programming and Scripting

Need assistance with a file issue and a terminal issue

Hello everyone, I'm in need of some assistance. I'm currently enrolled in an introductory UNIX shell programming course and, well halfway through the semester, we are receiving our first actual assignment. I've somewhat realized now that I've fallen behind, and I'm working to get caught up, but for... (1 Reply)
Discussion started by: MrMagoo22
1 Replies

3. Solaris

How to avoid "cannot execute" issue with a runnable jar file?

I am trying to understand why the runnable jar file runs on one Unix server, but not the other with same environment settings. I copied exact same test jar from here --> http://www.javaworld.com/javaworld/javatips/javatip127/MakeJarRunnable.zip on to both Unix servers. Then changed... (5 Replies)
Discussion started by: kchinnam
5 Replies

4. Shell Programming and Scripting

how to execute

Hi, I have a query for executing the script. I have a script in korn shell. Now I want to execute that script in the born shell. How can I execute. (3 Replies)
Discussion started by: nagraju.allam
3 Replies

5. UNIX for Dummies Questions & Answers

ISSUE and ISSUE.NET files

In LINUX(CentOS, RedHat) is there a way to have the banner statement appear before the logon instead of after the logon? In UNIX and Windows the banner appears before a person actually logs on, what I'm seeing in LINUX is that it appears after the login(ftp, telnet, SSH). Thanks (0 Replies)
Discussion started by: ejjones
0 Replies

6. Shell Programming and Scripting

execute

can someone tell me what is the difference between . and ./ in a script (3 Replies)
Discussion started by: TimHortons
3 Replies

7. Shell Programming and Scripting

Unix Arithmatic operation issue , datatype issue

Hi, I have a shell scripting. This will take 7 digit number in each line and add 7 digit number with next subsequent lines ( normal addition ). Eg: 0000001 0000220 0001235 0000022 0000023 ........... ......... ........ Like this i am having around 1500000 records. After adding... (23 Replies)
Discussion started by: thambi
23 Replies

8. Shell Programming and Scripting

execute

Hi All I have a file containing the following information SOURCESERVER DESTINATIONSERVER DESTINATIONENVIRONMENT CONDITION I was trying to read and then execute the conditions,like if SOURCESERVER is XXXX0001 and the DESTINATIONSERVER is XXXX0002 and the DESTINATIONENV is YYY the... (3 Replies)
Discussion started by: bkan77
3 Replies

9. Shell Programming and Scripting

script execute or no execute

o hola.. Tengo un script que se ejecuta bajo una tarea del CronJOb del unix, tengo la version 11 de unix, mi script tiene un ciclo que lee unos archivos .txt luego cada uno de esos archivos debe pasar por un procedimiento almacenado el cual lo tengo almacenado en mi base de datos oracle 10g,... (4 Replies)
Discussion started by: Kespinoza97
4 Replies

10. Shell Programming and Scripting

Need to execute 2 scripts, wait, execute 2 more wait, till end of file

:cool: I need to execute a shell script to do the following: cat a file run two back ground processes using the first two values from the file wait till those background processes finish run two more background processes using the next two values from the file wait till those background... (1 Reply)
Discussion started by: halo98
1 Replies
Login or Register to Ask a Question