issues with sql inside if statement


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting issues with sql inside if statement
# 8  
Old 10-12-2012
Quote:
Originally Posted by gary_w
The closing EOF must start at the very beginning of the line.
Not a necessity if you have <<-EOF instead of <<EOF. In the former case, EOF may be preceded by tabs.
This User Gave Thanks to elixir_sinari For This Post:
# 9  
Old 10-12-2012
hi gary,

Sorry, I did not understand what you said.

can you kindly show it in the above code...
# 10  
Old 10-12-2012
Please see my amended post above.
This User Gave Thanks to gary_w For This Post:
# 11  
Old 10-12-2012
Thanks a lot guys... the issue was due to the tab.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Command in inside awk statement

Hello can you please help me with below script which is meant to delete clients from multiple netbackup policies I want to run a command insdie awk statement apparelnlty this script is not working for me for i in $( cat clients_list) do bppllist -byclient $i | awk... (6 Replies)
Discussion started by: Sara_84
6 Replies

2. Shell Programming and Scripting

Multiple conditions inside if statement

I was trying to write multiple conditions inside the if statement but its not working. export VAR_NM=abc.txt export CURR_DT=20131011 export PREV_DT=20131012 if && then echo "Yes" else echo "NO" fi It should return Yes but returning NO always.Appreciate any help. (3 Replies)
Discussion started by: dr46014
3 Replies

3. Shell Programming and Scripting

Use sqlplus statement inside case sentence

Hello, I have a problem. I want to launch a different sql queries for different shell parameter values, something like this. #/bin/bash case $1 in "A") sqlplus -s user/pass << SQL query A; SQL "B") sqlplus -s user/pass << SQL2 ... (3 Replies)
Discussion started by: Vares
3 Replies

4. Shell Programming and Scripting

Multiple conditions inside my if statement

Hello, I am using shell scripting and I am recieving odd results from my if statement if I want it to enter the loop only if L1 is equal to zero and one of the other criteria are filled, however it is entering at other times as well. What can i do to fix this? i tried seperating it... (6 Replies)
Discussion started by: ryddner
6 Replies

5. Shell Programming and Scripting

Bash Script Issues (If statement for file copying)

Writing a bash script for use with Geektool, pulls the battery info, and shuffles images around so that an Image geeklet can display the correct expression as the desktop background. (Eventually I intend to make it more intricate, based on more variables, and add more expressions) I'm extremely... (1 Reply)
Discussion started by: The_Ardly374
1 Replies

6. Shell Programming and Scripting

Read from user inside a while statement

Hi there I want to ask to a user something about each line of a file. This is my code: #cat test.txt first line second line third line #cat test.sh #!/bin/ksh read_write () { echo "Do you want to print the line (YES/NO)?\n" read TEST case ${TEST} in YES) return 0;; ... (3 Replies)
Discussion started by: tirkha
3 Replies

7. Shell Programming and Scripting

if inside while statement (PLZ HELP)

hey guys i need some help here i am trying to do a bash shell script to get a parent PID and then search for all childs and kill them all without killing the parent, my problem is in the loop it seems that i dont know how to make a if statment inside a while statment it does not give me what i... (5 Replies)
Discussion started by: q8devilish
5 Replies

8. Shell Programming and Scripting

how to pass a variable to an update sql statement inside a loop

hi all, i am experiencing an error which i think an incorrect syntax for the where clause passing a variable was given. under is my code. sqlplus -s ${USERNAME}/${PASSWORD}@${SID} << END1 >> $LOGFILE whenever sqlerror exit set serveroutput on size 1000000 declare l_rc ... (0 Replies)
Discussion started by: ryukishin_17
0 Replies

9. Shell Programming and Scripting

How to call an sql script inside a while statement in KSH

Hi all, I'm trying to run an sql inside a loop which looks like this #!bin/ksh while IFS=, read var1 var2 do sqlplus -s ${USERNAME}/${PASSWORD}@${ORACLE_SID} << EOF insert into ${TABLE} ( appt_date ) values ( '${var1 }' ); ... (6 Replies)
Discussion started by: ryukishin_17
6 Replies

10. Shell Programming and Scripting

sql inside a script

Hi, In a KSH script i have to run a sybase query and get the count into a unix variable. How can i do that? Your help is much appriciated. Thanks, sateesh (4 Replies)
Discussion started by: kotasateesh
4 Replies
Login or Register to Ask a Question