Home » Developer & Programmer » Forms » Using TEXT IO built-in package in Oracle Forms
Using TEXT IO built-in package in Oracle Forms [message #85947] Mon, 16 August 2004 02:37 Go to next message
Radhika
Messages: 12
Registered: June 2001
Junior Member
We are migrating PRO*C programs to Oracle 6i. The PRO*C has almost 25 inserts, and I feel that Reports would not be a suitable alternative (performance slows down with all that DML). The PRO*C writes into the output file, and follows each write with an insert into a database table.

I am told that I can use TEXT_IO built-in package in Forms 6i to achieve the PRO*C's functionality. I am new to development and have never used this package before. Can anyone please guide me how to proceed and build a form using this package?

Thanks for your help in advance.

 
Re: Using TEXT IO built-in package in Oracle Forms [message #85950 is a reply to message #85947] Mon, 16 August 2004 07:33 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
Does the output file have to be written to the client ?
If not, sounds more like a PL/SQL module to me than forms.
Forms is not really about files (Can do, but not really meant to); it's more about data-entry.

For forms, here is a good example: http://www.orafaq.com/faqfrm6i.htm#FILEIO

hth
Re: Using TEXT IO built-in package in Oracle Forms [message #85955 is a reply to message #85947] Mon, 16 August 2004 21:55 Go to previous message
Himanshu
Messages: 457
Registered: December 2001
Senior Member
Hi,
The usage of TEXT_IO is fairly simple and is similar to usage of UTL_FILE.
The only difference is that the TEXT_IO will write the file on Client's loacl directory while UTL_FILE will write the file on SERVER's directory.

E.g. of TEXT_IO usage:

Procedure TEXT_WRITE(P_where Varchar2) is
IN_FILE TEXT_IO.FILE_TYPE;
L_where Varchar2(32000):=P_where;
Begin
IN_FILE := TEXT_IO.FOPEN('D:U0210.TXT','W');
TEXT_IO.PUT_LINE(IN_FILE,L_Where);
TEXT_IO.FCLOSE(IN_FILE);
Exception
When Others then
TEXT_IO.FCLOSE(FILEHANDLER);
Message('Error whil writing file.',No_Acknowledge);
End;

You may call this Procedure from when button pressed.

HTH
Regards
Himanshu
Previous Topic: forms
Next Topic: delete_record
Goto Forum:
  


Current Time: Sat Jul 20 07:28:33 CDT 2024