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: UTL_FILE package. Need Help!

Re: UTL_FILE package. Need Help!

From: <juhu2_at_my-deja.com>
Date: Thu, 15 Jul 1999 11:56:16 GMT
Message-ID: <7mki8t$do0$1@nnrp1.deja.com>


Hallo Suresh,

it seems not to be possible to write more than 1473 Bytes via put to a file without write_error exception. Obviously put_line has this problem not (at least in RDBMS 8.0.4.3.0). See also my posting from yesterday (<7mi551$hhu$1_at_nnrp1.deja.com>).

--
Ciao, Peter :-(((

In article <01becd7f$d6583c00$a504fa80_at_mndnet>,   "Suresh Bhat" <suresh.bhat_at_mitchell-energy.com> wrote:
> Hi -
>
> I think if you use put for the first 3 writes rather than putf, and
close
> only after the 4th line is written with putf, your problem will be
solved.
>
> Suresh Bhat
> Oracleguru
> www.oracleguru.net
> oracleguru_at_mailcity.com
>
> Art Vandeley <mannyotero_at_yahoo.com> wrote in article
> <7mfl9e$n0p$1_at_ash.prod.itd.earthlink.net>...
> > Hi,
> >
> > I have written a procedure using the UTL_FILE package to write data
from
> a
> > table to a text file. Unfortunately, each row of the data I am
writting
> is
> > pretty long, more than the allowed 1023 buffer.
> >
> > I have tried using UTL_FILE.FFLUSH in such a way that the procedure
would
> > write part of the row then flush the buffer and then write the last
part
> of
> > the row before continuing to the next row. This is not working.
> >
> > The only way I have been able to get the program to work is with the
code
> > below, where 'buffervariable1-4' are the four different variables
that
> make
> > up the entire row, each of them contains close to 1000 chars.
> >
> > By doing it the way I have it below the file is created but after
each
> CLOSE
> > command the program inserts a NEWLINE so that my one row of data is
> actually
> > on fours different rows.
> >
> > -------------- write data to out file --------------
> >
> > begin
> >
> > UTL_FILE.PUTF(filehandle, buffervariable1);
> > UTL_FILE.FCLOSE(filehandle);
> > filehandle := UTL_FILE.FOPEN('c:\utlfiles','svcordrs.txt','a');
> >
> >
> > UTL_FILE.PUTF(filehandle, buffervariable2);
> > UTL_FILE.FCLOSE(filehandle);
> > filehandle := UTL_FILE.FOPEN('c:\utlfiles','svcordrs.txt','a');
> >
> >
> > UTL_FILE.PUTF(filehandle, buffervariable3);
> > UTL_FILE.FCLOSE(filehandle);
> > filehandle := UTL_FILE.FOPEN('c:\utlfiles','svcordrs.txt','a');
> >
> >
> > UTL_FILE.PUTF(filehandle, buffervariable4);
> > UTL_FILE.FCLOSE(filehandle);
> > filehandle := UTL_FILE.FOPEN('c:\utlfiles','svcordrs.txt','a');
> >
> >
> > EXCEPTION
> >
> > WHEN OTHERS THEN
> >
> > DBMS_OUTPUT.PUT_LINE('ERROR ' || to_char(SQLCODE) || ' '
||
> > SQLERRM);
> > null;
> >
> > end;
> >
> > -----------------------------------------------------
> >
> >
> > Now, I have tried it this way but it hasn't worked:
> >
> >
> > -------------- write data to out file --------------
> >
> > begin
> >
> > UTL_FILE.PUTF(filehandle, buffervariable1);
> > UTL_FILE.FFLUSH(filehandle);
> >
> > UTL_FILE.PUTF(filehandle, buffervariable2);
> > UTL_FILE.FFLUSH(filehandle);
> >
> > UTL_FILE.PUTF(filehandle, buffervariable3);
> > UTL_FILE.FFLUSH(filehandle);
> >
> > UTL_FILE.PUTF(filehandle, buffervariable4);
> > UTL_FILE.FFLUSH(filehandle);
> >
> > UTL_FILE.NEW_LINE(filehandle,1);
> >
> >
> > EXCEPTION
> >
> > WHEN OTHERS THEN
> >
> > DBMS_OUTPUT.PUT_LINE('ERROR ' || to_char(SQLCODE) || ' '
||
> > SQLERRM);
> > null;
> >
> > end;
> >
> > -----------------------------------------------------
> >
> >
> > PLEASE HELP!!!!!!!
> >
> > Thanks,
> > Manny Otero
> > Developer / DBA
> > SLi Lighting Solutions
> > manny.otero_at_bigfoot.com
> >
> >
> >
> >
> >
> >
> >
>

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Thu Jul 15 1999 - 06:56:16 CDT

Original text of this message

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