Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

extract table using utl_file

445042Feb 21 2013 — edited Feb 21 2013
Hi aces,

I'm trying to extract a table to a linux file.

This is the code I'm executing and the error I get :

create or replace directory repr_utl_dir AS '/home/oracle';
GRANT read, write ON DIRECTORY repr_utl_dir TO sys;

declare
f utl_file.file_type;
begin
f := utl_file.fopen('repr_utl_dir','repr.txt','W');
for s in (select * from repr)
loop
utl_file.put_line(f,s);
end loop;
utl_file.fclose(f);
end;
/

ERROR at line 7:
ORA-06550: line 7, column 1:
PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'
ORA-06550: line 7, column 1:
PL/SQL: Statement ignored


Any ideas please ?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 21 2013
Added on Feb 21 2013
5 comments
578 views