Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Newbie to cursors...
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;
Thaanks Received on Thu Jan 04 2007 - 15:05:43 CST