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

Home -> Community -> Usenet -> c.d.o.server -> Re: Help with update query

Re: Help with update query

From: Pratap <pratap_fin_at_rediffmail.com>
Date: 23 Sep 2004 05:00:07 -0700
Message-ID: <830861d2.0409230400.3a1ea0cd@posting.google.com>


Hi,

Don't know what version you are using, but there is a way in Oracle 9i -

merge into calendar c
using
(

	select	rowid rid,
		rank() over (order by calendar_date) seq
	from	calendar
	where	business_day = 'Y'

) c1
on
(

        c.rowid = c1.rid
)
when matched then update
set c.business_day_sequence = c1.seq
when not matched then -- THIS IS JUST DUMMY, THIS WILL NEVER HAPPEN insert ( calendar_date )
values ( null );

I tried creating a view and then updating a view, but it does not allow view update because of the rank function.

Regards,

Pratap Received on Thu Sep 23 2004 - 07:00:07 CDT

Original text of this message

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