PL/SQL Question to solve

From: <myusuf_at_my-dejanews.com>
Date: 1998/05/23
Message-ID: <6k56ud$c33$1_at_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 [Quoted] no insertion in table2.The tricky part is if the the values of records which [Quoted] 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 [Quoted] 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 [Quoted] 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

[Quoted] -----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/ Now offering spam-free web-based newsreading Received on Sat May 23 1998 - 00:00:00 CEST

Original text of this message