Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Reading files on the server
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-----
Sent: Thursday, November 13, 2003 10:14 PM
To: Multiple recipients of list ORACLE-L
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? <http://uk.rd.yahoo.com/mail/tagline_messenger/*http://uk.messenger.yahoo.co m/> Get the FREE Yahoo! Messenger
-- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Bellow, Bambi INET: bbellow_at_chi.navtech.com Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-LReceived on Fri Nov 14 2003 - 10:59:25 CST
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
![]() |
![]() |