Using TEXT IO built-in package in Oracle Forms [message #85947] |
Mon, 16 August 2004 02:37 |
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 #85955 is a reply to message #85947] |
Mon, 16 August 2004 21:55 |
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
|
|
|