Hi,
I have a strange situation here. I'm trying to find the most efficient and least 'costly' way to insert records into a table.
Currently I am doing an INSERT...SELECT...
The new data I want to add will need to be updated before it is inserted ONLY IF the incoming data is null. For example
The problem with this is table C is HUGE and I'm doing 'NVL' conversions on several columns.
My question is...Can I create a cursor to retrieve all the records I want, then update the cursor records and insert them into the final table?
Thanks in advance!
I have a strange situation here. I'm trying to find the most efficient and least 'costly' way to insert records into a table.
Currently I am doing an INSERT...SELECT...
The new data I want to add will need to be updated before it is inserted ONLY IF the incoming data is null. For example
Code:
INSERT INTO <table> A
(SELECT B.col1
B.col2
nvl(C.col3, (SELECT DISTINCT col FROM <table> D
WHERE D.col = B.col))
FROM <table> B, <table> C
WHERE B.ID = C.ID (+)
AND B.NUM = C.NUM (+));
My question is...Can I create a cursor to retrieve all the records I want, then update the cursor records and insert them into the final table?
Thanks in advance!