Job Seekers   Employers
dbapool: Authors | Submissions | Contact Us
   Forgot password? | Sign up
  Home   Discussion Forum   Articles   Interview Questions   FAQs   Scripts   Rewards   Analyzer   White Papers   Blog   Certification   Downloads   Tools
 

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.



  


 Title: UTL_FILE
 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

  




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 Khokhar856
  Mohammed Taj746
  positive fanatic483
  Jayanta Sur479
  Vigyan Kaushik386
  Gitesh Trivedi322
  Gopu Gopi281
  neeraj sharma254
  Ramesh Jois245
  Bishal Khetan207






oracle Mag



  About Us Advertise Terms of Use Privacy Newsletters Contact Us    

Home   Discussion Forum   FAQs  Articles  Jobs   Newsletters  Directory  Downloads 

Our Premium Sponsor
Confio Software