There are really two answers to this and it depends largely on what you want to do.  If you want to check for the existence of a file and generate an error if it's not there, you can do something along the lines of...
 
whenever oserror <do something>
!ls -l $DIR/$FILENAME
 
Alternatively, if you want to do something that requires an action based on something inside the log file, you have to run the SQLPLUS command as a separate shell.  Here's an example:
 
sqlplus << EOF
userofchoice/incrediblysecretpassword
def somevar=`grep -i yourvar $DIR/$FILENAME|awk '{print $NForsomething}'`
def somevar2=$SOMETHINGFROMEARLIERINTHISPGM
select &somevar*&somevar2 from dual;
exit
EOF
 
HTH,
Bambi.
-----Original Message-----
From: Gunnar Berglund [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 13, 2003 10:14 PM
To: Multiple recipients of list ORACLE-L
Subject: Reading files on the server

Hi all,
 
I have a problem I hope you could help with.
 
I have a job running on db server side as a cron and it creates information (log files). What methods I have if I want to read those log files with some pl/sql procedure etc (I mean from inside the db), are there any others than utl_file (which I suppose reads always at the same directory...)
 
I am using 9iRel2 on Sun Solaris...
 
Thanks in advance
Gunnar


Want to chat instantly with your online friends? Get the FREE Yahoo! Messenger

Reply via email to