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 -> PL-SQL get_line, Help me

PL-SQL get_line, Help me

From: Chevalier Christophe <Chevalier_at_e-med.ch>
Date: Wed, 23 Feb 2000 10:05:11 +0100
Message-ID: <38B3A2C7.F631EB3D@e-med.ch>


Hello,

I have a problem with a procedure PL-SQL. I manage to open a textual file with method OPEN_FILE and GET_LINE, but if the file that I open contains of the lines of more than ~400 car, I have execption.

Also, here the code which I use to open my file.


CREATE OR REPLACE
 procedure L_FILE ( F_NAME in VARCHAR2, F_TYPE IN VARCHAR2 )IS

 FILE_OPEN UTL_FILE.file_type;
 LIGNE_LU VARCHAR2(2000) :=null ;

 BEGIN
  FILE_OPEN := UTL_FILE.fopen ( 'e:\temp' , F_NAME , 'r' );   LOOP
   BEGIN
    UTL_FILE.GET_LINE ( FILE_OPEN , LIGNE_LU );     DBMS_OUTPUT.PUT_LINE (LIGNE_LU);

   UTL_FILE.fclose ( FILE_OPEN );

    EXCEPTION
      when UTL_FILE.invalid_path then raise_application_error (
-20100 , 'Invalid path : "') ;

      when UTL_FILE.invalid_mode then raise_application_error (
-20101 , 'Invalid mode' ) ;

      when UTL_FILE.invalid_operation then raise_application_error (
-20101 , 'Write operation' ) ;

   when UTL_FILE.INVALID_FILEHANDLE then raise_application_error (
-20100 , 'INVALID_FILEHANDLE') ;

   when UTL_FILE.READ_ERROR then raise_application_error ( -20100 , 'READ_ERROR') ;
   when VALUE_ERROR then raise_application_error ( -20100 , 'VALUE_ERROR') ;

   when others                           then DBMS_OUTPUT.PUT_LINE
('C''est une autre erreur !!!!!');
      UTL_FILE.fclose ( FILE_OPEN ) ;

  END;
/

Somebody with already have the same problem, and how to solve it.

Thank you in advance.

To afflict for my bad English Received on Wed Feb 23 2000 - 03:05:11 CST

Original text of this message

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