Home » Developer & Programmer » Forms » TEXT_IO Package usage
TEXT_IO Package usage [message #161128] Thu, 02 March 2006 03:21 Go to next message
nirmalnarayan
Messages: 261
Registered: April 2005
Location: India
Senior Member
Hi,


the following procedure using TEXT_IO package is from the help topics of Oracle Forms 10g. While calling this procedure it is giving non-Oracle error. Anyone can help in this regard ?




PROCEDURE echo_file_contents IS
in_file Text_IO.File_Type;
linebuf VARCHAR2(1800);
filename VARCHAR2(30);
BEGIN
filename:=GET_FILE_NAME('c:/temp/', File_Filter=>'Text Files (*.txt)|*.txt|');
in_file := Text_IO.Fopen(filename, 'r');
LOOP
Text_IO.Get_Line(in_file, linebuf);
:text_item5:=:text_item5||linebuf||chr(10);
--Text_IO.New_Line;
END LOOP;
EXCEPTION
WHEN no_data_found THEN
Text_IO.Put_Line('Closing the file...');
Text_IO.Fclose(in_file);
END;

Nirmal
Re: TEXT_IO Package usage [message #161134 is a reply to message #161128] Thu, 02 March 2006 03:45 Go to previous messageGo to next message
orausern
Messages: 826
Registered: December 2005
Senior Member
can u post the exact error message you get?
Re: TEXT_IO Package usage [message #161146 is a reply to message #161134] Thu, 02 March 2006 04:30 Go to previous messageGo to next message
nirmalnarayan
Messages: 261
Registered: April 2005
Location: India
Senior Member
Hi,

I am getting the error as shown in the graphic. I am getting when the button is pressed. And the Button pressed is calling the procedure , which i have posted earlier (As in the Forms10g Help Topics)

/forum/fa/851/0/

Thanks and Regards,

Nirmal
  • Attachment: Text_IO.bmp
    (Size: 1.16MB, Downloaded 11456 times)

[Updated on: Thu, 02 March 2006 04:31]

Report message to a moderator

Re: TEXT_IO Package usage [message #161149 is a reply to message #161146] Thu, 02 March 2006 04:41 Go to previous messageGo to next message
orausern
Messages: 826
Registered: December 2005
Senior Member
no, i can't figure out the exact cause,but looking at your procedure code, there seems to be something wrong the way you are calling the procedure:

filename:=GET_FILE_NAME('c:/temp/', File_Filter[B]=>[/B]'Text Files (*.txt)|*.txt|');



just as you set the paramater of File_Filter with => symbol, you have to do the same for the first parameter c:/temp/

also check the existance ofthe directory and file and permissions to it.

[Updated on: Thu, 02 March 2006 04:42]

Report message to a moderator

Re: TEXT_IO Package usage [message #189794 is a reply to message #161128] Sun, 27 August 2006 15:19 Go to previous message
amadeus_cr
Messages: 1
Registered: August 2006
Location: CR
Junior Member
try changing from :

in_file := Text_IO.Fopen(filename, 'r');

to

in_file := Text_IO.Fopen(filename, 'w');



i get the same error because of that !
Previous Topic: Alert Buttons
Next Topic: menu toolbar not visible on form
Goto Forum:
  


Current Time: Fri Sep 20 11:43:20 CDT 2024