Topic: SQL*Plus and PL/SQL >> UTL_FILE
|
Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property.
You may review the entire Oracle Certification Program Candidate Agreement online Here.
|
|
|
|
| Preethe |
Posted: Jan 27, 2005 02:13:16 AM |
Total Post: 1
Joined: Jan, 2005
|
hi all
I have a simple block to spool the data of a ref cursor into a file using utl_file handle.
DECLARE
FILE_HANDLE UTL_FILE.FILE_TYPE;
FILE_NAME VARCHAR2(40);
STMT VARCHAR2(200);
EXTRACT VARCHAR2(5000);
TNAME VARCHAR2(100);
T_REC TNAME%rowtype;
TYPE C_TYPE IS REF CURSOR;
C_EXT C_TYPE;
BEGIN
TNAME ='EMPLOYEE';
STMT:='select * from EMPLOYEE';
open C_EXT for stmt;
FETCH C_EXT INTO T_REC;
FILE_HANDLE:= UTL_FILE.FOPEN('C:\','test_utl.txt','W');
UTL_FILE.PUT_LINE(FILE_HANDLE,T_REC);
CLOSE C_EXT;
UTL_FILE.FCLOSE(FILE_HANDLE);
END
When i execute this block .. i get the following error:
UTL_FILE.PUT_LINE(FILE_HANDLE,T_REC);
*
ERROR at line 15:
ORA-06550: line 15, column 2:
PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'
ORA-06550: line 15, column 2:
PL/SQL: Statement ignored
Can anyone pls explain where i am going wrong ..
Thanks in advance
Preethe |
|
|
Jyoti |
| Posted: Jun 20, 2005 06:43:34 AM | |
|
Total Post: 13
Joined: Nov, 2004
|
You have to specify cursor_name.field_name. Since Cursor type is not directly referred by the utl_file package
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |
|
|
|
|
Forum Rules & Description
Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user
|
| |
Get FREE Magazines
|
Top 10 Forum User
|
| Murtuja Khokhar | 856 |
| Mohammed Taj | 746 |
| positive fanatic | 483 |
| Jayanta Sur | 479 |
| Vigyan Kaushik | 386 |
| Gitesh Trivedi | 322 |
| Gopu Gopi | 281 |
| neeraj sharma | 254 |
| Ramesh Jois | 245 |
| Bishal Khetan | 207 |
|
|