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 -> Updating tables using cursor, I need help

Updating tables using cursor, I need help

From: <myusuf_at_my-dejanews.com>
Date: 1998/05/24
Message-ID: <6k865o$2k7$1@nnrp1.dejanews.com>#1/1

I have the following table table1, table2 . My cursor read table1 and insert table2 with a values based on the folowing criterion: test2 table is empty.Using cursor the first record 'aa' is read and insert to table2. if the following records are the same as the first record no insertion in table2.The tricky part is if the the values of records which has already been read and inserted into table2 appears again, all those records will be flaged in table1 as 'Y', that is table1 flag column will be updated with the value of 'Y'. the same rule applies with all records. In other words always the cursor has to check for values in table2 to validate the values. The tables and the final outputs looks as follows

note : table1 colmn flg is all null before update.

select * from table1;

col1 flg
aa
aa
aa
bb
bb

aa       Y
aa       Y

cc
cc
bb Y

table table2
aa
bb
cc

these errorr ecords in table1 6 ,7 and 9th

thanks in advance
Yusuf
myusuf1_at_followme.com

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/ Now offering spam-free web-based newsreading Received on Sun May 24 1998 - 00:00:00 CDT

Original text of this message

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