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 -> Newbie to cursors...

Newbie to cursors...

From: <i5ha_at_yahoo.com>
Date: 4 Jan 2007 13:05:43 -0800
Message-ID: <1167944743.119706.12230@s80g2000cwa.googlegroups.com>


Hi everyone,
I'm quite new to Oracle and am trying to do some data warehousing tasks. I've written a few cursors (sample shown below) but none of them do what they are supposed to do! N I just can't debug them, can anyone please help?

--This cursor is supposed to populate my fact table Cover_fact, which is initially empty...
Declare

	Cursor c_fact is
		Select Session_id, Lrequest_id, Practice_id, Locum_id, Time_code,
Status
		From Cover_fact;
Begin
	For cover_rec in c_fact LOOP
	INSERT into cover_fact(Session_id, Lrequest_id, Practice_id,
Locum_id, Time_code, Status)
	SELECT Session_id, Lrequest_id, Practiceid, Locum_id, Tseq.nextval,
Status
	FROM session2, lrequest
	WHERE session2.Lrequest_id = lrequest."LocumRequestID";
	END LOOP;
                Commit;

End;

Thaanks Received on Thu Jan 04 2007 - 15:05:43 CST

Original text of this message

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