Answer the question
In order to leave comments, you need to log in
How to write data to a file using UTL_FILE?
Do not judge strictly, there is no experience.
I do something like this, only instead of txt I have a csv file.
begin
4 v_handle := Utl_File.Fopen(location => 'EXPGG',
5 filename => 'test.txt',
6 open_mode => 'w',
7 max_linesize => 32767);
8 for z in (select val from tst) loop
9 Utl_File.put_line(v_handle, z.val);
10 end-loop;
11 Utl_File.FClose(v_handle);
12 end;
But I have several fields in tst and I need them all when I just enumerate in a loop,
9 Utl_File.put_line(v_handle, z.val1, z.val2, etc);
then the error appears PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'
Would it be correct to do so for z in (select ||'"'||val1||'";"'||val2||'" ;"'|| etc. from tst) loop ??
Or is it somehow done differently? Does each value need to be wrapped in quotes?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question