UTL_FILE. FOPEN and ora-06502

275 Views Asked by At

I have to read a big file line by line, usually more than 400 kb, change some values and write the file changed in another file.

My problema now is that I'm having a ora-06502 in the fopen .... the code is like this

CREATE OR REPLACE PROCEDURE pfichero (pnomficheroorigen in VARCHAR2, 
    pnomficherodestino in varchar2) AS
  
    vcdclasnm varchar2(2) := '01';
    vhabilitacion_destino varchar2(3) := 'PRU';
    v_filehandleorigen UTL_FILE.FILE_TYPE;
    v_filehandledestino UTL_FILE.FILE_TYPE;
    v_nomficheroorigen VARCHAR2(50) := pnomficheroorigen;
    v_nomficherodestino VARCHAR2(50) := pnomficherodestino;
    v_linea varchar2(32767);
    vlineadestino varchar2(32767);
BEGIN
    dbms_output.put_line ('traza 0: '||v_nomficheroorigen);
    v_filehandleorigen  := UTL_FILE.FOPEN('DIR_DESA',v_nomficheroorigen,'R',32767);
    dbms_output.put_line ('traza 1');
    v_filehandledestino := UTL_FILE.FOPEN('DIR_DESA',v_nomficherodestino,'W',32767);

The error ocurrs on the line "v_filehandleorigen := UTL_FILE.FOPEN('DIR_DESA',v_nomficheroorigen,'R',32767);".

Can anyone can help me?

Thanks a lot

0

There are 0 best solutions below