Forms 9i [message #84563] |
Tue, 30 March 2004 23:15 |
dipankar saha
Messages: 36 Registered: March 2004
|
Member |
|
|
Dear friends,
i want to know that whether i can read from or write into a text file or a doc file using froms 9i, whether ite is possible to acheive using pl/sql. if any one of u have any idea about this please help, a demo code in this regard will be an extra help.
thanking u , dipankar saha
|
|
|
Re: Forms 9i [message #84622 is a reply to message #84563] |
Wed, 07 April 2004 00:37 |
Rajesh B. Rasale
Messages: 2 Registered: April 2004
|
Junior Member |
|
|
Please try this code.
DECLARE
fileHandler UTL_FILE.FILE_TYPE;
BEGIN
fileHandler := UTL_FILE.FOPEN('/tmp', 'myfile', 'w');
UTL_FILE.PUTF(fileHandler, 'Look ma, I''m writing to a file!!!n');
UTL_FILE.FCLOSE(fileHandler);
EXCEPTION
WHEN utl_file.invalid_path THEN
raise_application_error(-20000, 'ERROR: Invalid path for file or path not in INIT.ORA.');
END;
|
|
|
Re: Forms 9i [message #84627 is a reply to message #84622] |
Wed, 07 April 2004 02:42 |
dipankar saha
Messages: 36 Registered: March 2004
|
Member |
|
|
dear rajesh,
thanks for the code but after i ran this code i got the following error message:
SQL> DECLARE
2 fileHandler UTL_FILE.FILE_TYPE;
3 BEGIN
4 fileHandler := UTL_FILE.FOPEN('/tmp', 'myfile', 'w');
5 UTL_FILE.PUTF(fileHandler, 'Look ma, I''m writing to a file!!!n');
6 UTL_FILE.FCLOSE(fileHandler);
7 EXCEPTION
8 WHEN utl_file.invalid_path THEN
9 raise_application_error(-20000, 'ERROR: Invalid path for file or path
10 not in INIT.ORA.');
11 END;
12 /
DECLARE
*
ERROR at line 1:
ORA-20000: ERROR: Invalid path for file or path
not in INIT.ORA.
ORA-06512: at line 9
i have a folder in the cdrive named tmp and do i have to create the file myfile also
thanking u,
dipankar
|
|
|
Re: Forms 9i [message #84633 is a reply to message #84627] |
Wed, 07 April 2004 19:11 |
rajesh
Messages: 173 Registered: November 1998
|
Senior Member |
|
|
Diapnakar ,
You please create the 'Myfile' and also you include the path in FORMS_Path in the Registry.
Hope this will work.
Rajesh
|
|
|