Your SQL session will presumeable display the correct results to you, so what you need to do with the shell script is to read them in.
Are you expecting a single line with two values from your SQL or two lines?
If it is the latter, then after you EOF, try inserting the following:-
This may hang if your shell decides it really wants to display the answers and then read input from the keyboard. Perhaps you need to change then end of your SQL block to read:-
Does that steer you towards a solution?
If not, can you run the SQL bit and paste the output from that and I'm sure someone will get it sorted.
I hope that this helps,
Robin
Liverpool/Blackburn
UK
Here's an example I did once to illustrate reading output from SQL/Plus and putting the data returned into shell variables. Maybe the general framework here will help you. This is ksh93 on Solaris:
P.S. You best change your apps password ASAP!!!
If indenting makes the code more readable, I have found that using a TAB characters to indent is acceptable to ksh, however spaces are a definite no-no.
If indenting makes the code more readable, I have found that using a TAB characters to indent is acceptable to ksh, however spaces are a definite no-no.
Tabs or spaces makes no difference with <<, both will cause the terminator to be ignored.
If you use <<-, you can use tabs (but not spaces).
EDIT: As methyl said. (*curses lack of delete button* )
EDIT2: And apparently <<# allows both (on ksh93, at least).
Ceiling Light - The Forgotten Element
One of the highest details concerning using an LED ceiling panel essentially offer a fantastic dance floor which definitely makes the customers dance right away.They are a quite low cost method of something like a lighting solution, simple collection up,... (1 Reply)
Need ideas on how to achieve the below.
We have a script say "profile.sh" which internally calls another existing script called "name.sh" which prompts for the
name and age of a person upon execution. When i run profile.sh how can i populate a pre-defined value from another file and pass that... (1 Reply)
I want to make a config file which contain all the paths.
i want to read the config file line by line and pass as an argument on my below function.
Replace all the path with reading config path line by line and pass in respective functions.
how can i achieve that?
Kindly guide.
... (6 Replies)
Hi All,
I am calling a series of shell scripts via CRON so everything is running as root. However, in my error log file I am seeing the following errors. Please can anyone offer any advise as to the possible causes and solution to prevent the errors from appearing.
The Error 1227 seems to... (2 Replies)
I'm trying to call shell scripts from Java for DB operations. Using a very simple test, for some reason, one line of (ALTER TABLE) in the shell simply won't be executed while the exit value from the call is "0" (valid exit). When I run the script directly in Unix, it gets executed perfectly fine!!... (4 Replies)
There are two files one is shell script (sample.sh) and another is configuration file (sampl_conf.cfg)
configuration file contains one variable $FTP_HOME. the value of this variable vaires for user to user. If user is say jadoo then value is /home/jadoo/ftp/, for user1 - /home/user1/ftp. The... (4 Replies)
I'm writing a shell script. I want to put the variables in a separate config files and use those inside my script.
e.g. the config file (temp.conf)will have the values like
mapping=123
file_name=xyz.txt
I want to access these variables in temp.conf(i.e. mapping and file_name) from inside the... (7 Replies)
Hi all,
I have two ksh scripts
#sample1.sh
#!/bin/ksh
. ./sample2.sh
echo $fileExist
#sample2.sh
#!/bin/ksh
func()
{
i=1
return $a
}
func
echo $?
Here how should I return the value of sample2.sh back to sample1.sh?
Thanks in advance. (2 Replies)
I'm puzzled by this one. I hope you can explain it to me.
I have a ksh shell script that gzips a file among other things. This works perfectly fine when the script is manually run through a shell. However, when the same script is run through cron, it does everything correctly, but it will... (2 Replies)