Best approach for my problem
Date: 16 Aug 2001 07:51:12 -0700
Message-ID: <142f748f.0108160651.7ee03a88_at_posting.google.com>
Hi guys,
I need your help in solving the following problem:
I have staging table with the following structure:
Deal# Division# Product# Processed_flag
I need to write to following tables as follows:
Deal table division table Product table
I defined 3 cursors for the processing the rows.
for d_rec in deal_cursor
100 126 121212
100 127 121213
100 126 121213
100 128 121215
101 126 121215
101 127 121215
101 126 121216
....
....
deal# Deal# div# deal# prod#
---- ------ ------ ----- ------
100 100 126 100 121212
101 100 127 100 121213
100 128 100 121215
101 126 101 121215
101 127 101 121216
loop
insert into deal table;
t_deal_no := d_rec.deal_no;
for div_rec in division_cursor
loop
insert into division table;
end loop;
for prod_rec in product_cursor
loop
insert into product table;
end loop;
end loop;
The trick is I need to log an error if there is a problem with the
data:
eg:
101 126 121215 ------> If the product is not valid in this record, I
should NOT set the processed_flag to 'Y'. So the division 126 for deal 100 also should not beinserted.
HOW DO I DO THAT? Please help
Thanks in advance
-Reddy Received on Thu Aug 16 2001 - 16:51:12 CEST