Simplest .... if you know the format of the files ... use external tables.
 
Raj
--------------------------------------------------------------------------------
Rajendra dot Jamadagni at nospamespn dot com
All Views expressed in this email are strictly personal.
QOTD: Any clod can have facts, having an opinion is an art !
-----Original Message-----
From: Bellow, Bambi [mailto:[EMAIL PROTECTED]
Sent: Friday, November 14, 2003 11:59 AM
To: Multiple recipients of list ORACLE-L
Subject: 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-----
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

**************************************************************************************
This e-mail message is confidential, intended only for the named recipient(s) above and may contain information that is privileged, attorney work product or exempt from disclosure under applicable law. If you have received this message in error, or are not the named recipient(s), please immediately notify corporate MIS at (860) 766-2000 and delete this e-mail message from your computer, Thank you.
**************************************************************************************4

Reply via email to