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

Home -> Community -> Usenet -> c.d.o.misc -> Simple FOR loop

Simple FOR loop

From: Knut E. Meidal <knut_meidal_at_email.com>
Date: 4 Apr 2003 13:23:05 -0800
Message-ID: <64c6c1ea.0304041323.2b905125@posting.google.com>


Using Oracle 9.0.1, this is what I want to do:
* Create a simple loop iterating over a set of date values

I'm using SQL Navigator for doing this, but it will be put in a stored procedure onvce I figure this out.
I'm not really able to create this in an easy way, which I hoped. I hoped to do it using a simple FOR loop, and avoid some cursor programming (since I'm not really a PL/SQL programmer)

I've been trying something like this:

declare l_dateval date;

for l_dateval in (select distinct date_col from slv) loop

    update slv
    set slv.settledayhist = (select s.settleday from statement s where s.id = slv.setl_id)

    where slv.settleday = to_date('27.02.2003', 'DD.MM.RRRR')     and slv.settledayhist IS NULL;
end loop;

Any insights? Can it be done?

Thanks in advance
Knut Received on Fri Apr 04 2003 - 15:23:05 CST

Original text of this message

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