Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: UTL_FILE question
Thanks Connor,
I'll give it a try. but i am still not quite sure how i can manipulate the file name so that for month1, filename is <filename_200201.txt> month2 - <filename_200202.txt.
Thanks again for your help!
Connor McDonald <hamcdc_at_yahoo.co.uk> wrote:
declare
prev_mth number := -1;
begin
for i in my_big_24mth_cursor loop
if to_number(to_char(i.date_of_interest,'MM')) != prev_mth then
if utl_file.is_open(f) then
close file;
end if;
open file;
prev_mth := to_number(to_char(i.date_of_interest,'MM'));
end if;
write line to file
end loop;
end;
or thereabouts
hth
connor
Co-author: "Mastering Oracle PL/SQL - Practical Solutions" - available now web: http://www.oracledba.co.uk web: http://www.oaktable.net
"GIVE a man a fish and he will eat for a day. But TEACH him how to fish, and...he will sit in a boat and drink beer all day"
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html ----------------------------------------------------------------- --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! ---------------------------------------------------------------- Please see the official ORACLE-L FAQ: http://www.orafaq.com ---------------------------------------------------------------- To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line. -- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html -----------------------------------------------------------------Received on Sun Feb 01 2004 - 11:18:00 CST
![]() |
![]() |