| Select Subquery vs For Loop [message #41766] |
Thu, 30 January 2003 07:53  |
Michele
Messages: 77 Registered: December 2000
|
Member |
|
|
I have a question in regards to what is the best approach.
I have to write a stored procedure that takes all the data from 5 tables and insert all records into 1 table.
My first thought was to write a stored procedure that looks like this:
insert into x
(select....)
Now the subquery is about 25 lines long. It entails getting data from about 5 different tables and using the Decode statement.
Or should my approach be to write For Loops for each table where I loop through each table and insert the record into table x.
Any thoughts would be appreciated. Thanks.
|
|
|
|
|
|