Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> pl/sql question,try this
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
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 Thu May 21 1998 - 21:07:10 CDT
![]() |
![]() |