Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Help me with my log

Re: Help me with my log

From: <asprusch_at_my-dejanews.com>
Date: Tue, 28 Jul 1998 14:54:50 GMT
Message-ID: <6pkonq$sjm$1@nnrp1.dejanews.com>


Try to use a trigger in combination with the utl_file-Package. Don't forget to set the utl_file_dir in the init.ora (Read the information in /rdbms/admin/utlfile.sql!).

CREATE TRIGGER <triggername>
AFTER UPDATE OR INSERT ON <tablename>
FOR EACH ROW
DECLARE
  ExpFile UTL_FILE.FILE_TYPE;
  FileBuf VARCHAR2(2000);

BEGIN   ExpFile := UTL_FILE.FOPEN(<Directory>, <Filename>, 'a');   FileBuf := RPAD(:NEW.<col1>,<col1length>) || RPAD(:NEW.<col2>,<col2length>);   UTL_FILE.PUT_LINE(ExpFile, FileBuf);
  UTL_FILE.FCLOSE(ExpFile);

END; Hope this will help
Andreas Prusch

In article <35bdbe65.2036533_at_news.singnet.com.sg>,   dennygoh_at_mbox5.singnet.com.sg (Daniel) wrote:
> I have a client server application (VB5/Oracle8.03) I need to
> maintain a log file (text file) containing data items of part of my
> table's record whenever a new record is created. Each of this record
> should be appended to my log file named as part of the system date.
> Thus the next day... a new log file created named as the system date
> (to keep track of the specific daily transaction ) .. and so on...
>
> Hope some guru out there can please tell me if this is possible on my
> Unix server and how to go about it....
>
>

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum Received on Tue Jul 28 1998 - 09:54:50 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US