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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Unable to write more than 1K with UTL_FILE

Re: Unable to write more than 1K with UTL_FILE

From: QuestionExchange <USENET_at_questionexchange.com>
Date: 18 Nov 1999 21:13:58 GMT
Message-ID: <2708qx@questionexchange.com>


> please try this with a DB oracle 7.3.xx:
>
> declare
> OUT_FILE UTL_FILE.FILE_TYPE;
> buffer varchar2(10) := 'a';
> counter integer := 0;
> begin
> OUT_FILE:=UTL_FILE.FOPEN('c:\temp\', 'test.txt', 'w');
> if utl_file.is_open(OUT_FILE) then
> while true loop
> UTL_FILE.PUT(OUT_FILE, buffer);
> UTL_FILE.FFLUSH(OUT_FILE);
> Counter := Counter+1;
> end loop;
> end if;
> utl_file.fclose(OUT_file);
> exception
> when others then dbms_output.put_line('record #:' ||
Counter);
> end;
> /
>
> as you can see the procedure exits at character 1023.
>
> I've to manage records with much more data, can anybody
suggest me a soluton?
>
> thank you in advance,
> Raffaele
>
>

your problem is a simple one. you need to include a utl_file.new_line or utl_file.put_line prior to filling the buffer which can only hold 1023 bytes for any version of oracle prior to 8.0.3. if you were running 8.0.3 or above the limit is 32K.
the utl_file.fflush doesnt do anything if the buffer has no eol character in it and the new_line/put_line will force this character into the buffer.
andre azaroff
aazaroff_at_redrose.net
==========MODIFIED=========
11/9/99 4:15 PM



the 1023 limit (1022 actually because the eol character takes up one byte) is a limit imposed by oracle no way around it.

--
  This answer is courtesy of QuestionExchange.com   http://www.questionexchange.com/showUsenetGuest.jhtml?ans_id=7721&cus_id=USENET&qtn_id=7952 Received on Thu Nov 18 1999 - 15:13:58 CST

Original text of this message

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