Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Text-file
"Terry Dykstra" <dontreply_tddykstra_at_forestoil.ca> a écrit dans le message
news:<TUqF9.16224$yV1.1096781_at_news1.telusplanet.net>...
> In 9i you can define a table that reads directly from a text file.
How to do that ?
I found UTL_FILE package to do that but I've got an error when I call open_file function here is my procedure :
CREATE OR REPLACE PROCEDURE TEST_FILE IS fichier UTL_FILE.FILE_TYPE;
ligne varchar2(2000);
error varchar2(2000);
BEGIN fichier := UTL_FILE.FOPEN('c:\testfile','test','R');
UTL_FILE.GET_LINE(fichier,ligne);
DBMS_OUTPUT.PUT_LINE(ligne);
EXCEPTION WHEN UTL_FILE.INVALID_OPERATION THEN DBMS_OUTPUT.PUT_LINE('invalid_operation');
WHEN UTL_FILE.READ_ERROR THEN DBMS_OUTPUT.PUT_LINE('read_error');
END TEST_FILE; /
so what is wrong in it ?
> "s Lehaire" <s.lehaire_at_meilleuregestion.com> wrote in message
> news:as55kv$78a$1_at_reader1.imaginet.fr...
> > Hi,
> > I know that is possible to write into a file the resultset of a query
with
> > the spool option.
> > but is it possible to read a text file to put the data into a table ?
> > Thx for response
> > ++
> >
> >
>
>
Received on Thu Nov 28 2002 - 10:23:27 CST