Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: UTL_FILE question

Re: UTL_FILE question

From: Connor McDonald <hamcdc_at_yahoo.co.uk>
Date: Sun, 1 Feb 2004 10:32:34 +0000 (GMT)
Message-ID: <20040201103234.47340.qmail@web25201.mail.ukl.yahoo.com>


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   


Connor McDonald
Co-author: "Mastering Oracle PL/SQL - Practical Solutions" - available now
web: http://www.oracledba.co.uk
web: http://www.oaktable.net

email: connor_mcdonald_at_yahoo.com

"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"



BT Yahoo! Broadband - Free modem offer, sign up online today and save £80 http://btyahoo.yahoo.co.uk

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 - 04:32:34 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US