@Corona688 - I created a new script, the content is:
It created a file called selectupdateX.txt, and the contents are:
I did try adding a -r after sqlplus, however when executing the script the sqlplus help popped up and nothing else happened (no file).
I'll keep playing with this, but do you have any more ideas?
@Peasant - I tried your script too:
This generated the following error:
I haven't attempted to figure out the errors yet.
I'm going to keep trying with both versions.
Not sure I'll be able to put bash scripting as a skill on my CV just yet
Cheers,
g
---------- Post updated at 09:14 AM ---------- Previous update was at 03:34 AM ----------
There's something "wrong" with the SQL that I'm running within <script.sql>. Basically the SQL generates a whole load of UPDATE statements through CASE statements.
When I do something like this...
...then the selectupdateX.txt file is generated with a list of ids!!
When I do something like this...
...then the selectupdateX.txt file is generated with nothing other than some sqlplus stuff, no UPDATE statements at all.
The issue I have looks like it's because of something dodgy happening with the SQL, and not the UNIX script itself... but maybe I'm wrong...
---------- Post updated at 09:31 AM ---------- Previous update was at 09:14 AM ----------
Got it, and I feel pretty stupid. I failed to add a semi colon to the end of my massive select statement, so... that's the reason it wasn't doing what I hoped.
I have automated some checks - and I want to send a email when there is an issue.
This is fine and I can send the email.
However - I want to generate the email in html format so I can highlight any issues to a reader..
ie. If there is a disk space issue - then the email will highlight the... (2 Replies)
Hi,
I have a UNIX script which calls SQL Select statement:
Now i want to use the output of that select statement within my UNIX script so as to call different shell script depending upon the output of the select statement.
Can anyone help me in this regard.
TIA
Akhil Goel (4 Replies)
Hi,
My local server is :/usr/abcd/
Remote server is :/Usr/host/test/
I want to send files from local unix directory(All files starting with O_999) to
remote host unix directory.
Can any body give me the Unix Shell script to do this.
One more doubt: Shall we need to change the file... (1 Reply)
I am pretty new to Unix shell scripting, but wondered if anyone could help (in layman's terms if possible!!) :)
I have a shell script which ultimately sends an alert to an email address if part of a batch of programs fails. Here's the script that sends the email:
Script: 6check.csh... (8 Replies)
Dear Friends,
I am working on IBM AIX. I have written one script and kept in the crontab as to run daily at 11:38 AM. and the output of the script to be appended to the file generated with the month name. but my file deleting daily and the new file is creating with the output of the shell... (2 Replies)
Hi
i have a script which executes daily through cron. The output of the script is appended to a log file everyday
It also emails me the output of the logfile as we have the mailx command in the script
The below is my requirement :
Normally When I get the email it sends the entire content... (3 Replies)
Hi,
I need to connect to the database and retrieve two variables from the database and store them in a variable,out of these two variables I need to get lastdigit appended to the variable 1 retrieved and variable 2 with out any modification
in short
select var,data from usage;
o/p=... (1 Reply)
Hi,
I've a list of files
ac_info.tps, subscription_array.tps, .......and many other files
one of the file, bin_range_list.tps has the following content
CREATE OR REPLACE TYPE "BIN_RANGE_LIST" AS TABLE OF BIN_RANGE_ELEM;
/
grant execute on... (4 Replies)
HI,
I want to connect to database and fetch the count from a table.
The sql query is as below :
select count(*) from table_test where test_column='read';
How can I print the output of this statement using shell script.
Thanks in advance. (4 Replies)
cd /opt/et/WAS/apps/8.0
find . -name "HostIntegration.properties" -o -name "HostSocket.properties" -o -name "environment.properties" 2> /dev/null | awk -F '' '{print $4}'|awk '!x++' | cat>/home/cbadmin/file1.txt
cd /home/cbadmin/
PS3='Please enter a number from list of applications==>:'
select... (3 Replies)