Re: Problem in TEXT_IO
From: <abhijit_jadeja_at_hotmail.com>
Date: Sat, 22 Aug 1998 06:44:43 GMT
Message-ID: <6rlpcs$lf1$1_at_nnrp1.dejanews.com>
END; In article <35D806B2.8D7B8734_at_oepm.es>, Paloma Angulo <par_at_oepm.es> wrote:
> Hi:
> How can I know if a file and his path exists with TEXT_IO?
>
> Can Anybody help me?
>
> Thanks in advance
>
>
Date: Sat, 22 Aug 1998 06:44:43 GMT
Message-ID: <6rlpcs$lf1$1_at_nnrp1.dejanews.com>
Dear Paloma,
I have written a function which does the same and
that works in forms 4.5.
In database pl/sql version remove message lines;
May be this will help,
Regards,
Abhi
function checkfile (in_file varchar2:='c:\readdata.txt') return boolean IS
new_file TEXT_IO.FILE_TYPE;
--Error message information
lv_sqlcode NUMBER; /* Place to hold SQLCODE */ lv_sqlerrm VARCHAR2(240); /* Place to hold SQLERRM */ lv_constr VARCHAR2(41); /* Place for Constraint Name */
BEGIN --Open data file to read
new_file:= TEXT_IO.FOPEN(in_file,'r');
TEXT_IO.FCLOSE(new_file);
return true;
EXCEPTION
/* ** If an error arises, the exception handler gets control */ when others then TEXT_IO.FCLOSE(new_file); lv_sqlcode := SQLCODE; lv_sqlerrm := SQLERRM; if lv_sqlcode=-302000 then message('Input Name Appears to be Incorrect. Check and Restart Job'); else TEXT_IO.FCLOSE(new_file); Message(lv_sqlerrm); Message(to_char(lv_sqlcode)); end if; return false;
END; In article <35D806B2.8D7B8734_at_oepm.es>, Paloma Angulo <par_at_oepm.es> wrote:
> Hi:
> How can I know if a file and his path exists with TEXT_IO?
>
> Can Anybody help me?
>
> Thanks in advance
>
>
-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum Received on Sat Aug 22 1998 - 08:44:43 CEST