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: unnecessary linefeed

Re: unnecessary linefeed

From: Jan <janik_at_pobox.sk>
Date: 29 Sep 2004 03:24:39 -0700
Message-ID: <81511301.0409290224.3080f723@posting.google.com>


Tested on Oracle 9.2.0.1 ....



CREATE DIRECTORY TEST_DIR AS 'c:\';

DECLARE
v VARCHAR(1000):=LPAD('X',1000,'X');
v_file utl_file.file_type;

BEGIN
  v_file:=utl_file.fopen('TEST_DIR','a.txt','w',32767);  

  FOR i IN 1 .. 1000 LOOP
    UTL_FILE.PUT_LINE (v_file,v,TRUE);
  END LOOP;
  UTL_FILE.FCLOSE(v_file);
END;


This test implies that you don`t need to open/close a file every xxx bytes,
you probably hit the limit of the VARCHAR datatype. I so, then just rest the variable which represents "buffer" in UTL_FILE.PUT_LINE.

BTW, if you want to see messeges in this newsgroup immediatly then go at:
 http://www.orafaq.net/usenet/now/thread.php?group=comp.databases.oracle.server

Jan

hegyvari_at_ardents.hu (Hegyvari Krisztian) wrote in message news:<9003d46f.0409282212.7c17b041_at_posting.google.com>...
> Hello All,
>
> I use utl_file to produce a "relative" file for UNIX. This file has to
> maintain the following characteristic:
>
> - absolutely no linefeed at all
>
> The problem I first came across was that I had to close the file and
> re-open again with append after every 32768 bytes, otherwise Oracle
> sent me an exception when I wanted to close the file. This is not a
> problem. The problem is, that after every utl_file.fclose a linefeed
> is appended to the file. I use utl_file.put to write the data between
> fopen and fclose and I never send any linefeed out.
>
> Any ideas how to change this? Currently I am seriously thinking to
> abandon utl_file and use Java to do the filewriting, the only pain
> being that the package is already ready and I am not a Java expert.
>
> Running on 8.1.7.4 and 8.1.7.2
>
> Cheers,
>
> Hegyvari Krisztian
>
> pls cc any answers to hegyvari_at_ardents.hu, if there is an answer I
> would be very happy to get it as soon as possible
Received on Wed Sep 29 2004 - 05:24:39 CDT

Original text of this message

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