Requires Free Membership to View
INSERT INTO TABLE1 SELECT C1, C2, C3 FROM TABLE2;Of course, you better make sure that the columns being selected from TABLE2 "match up" with the columns of the TABLE1. But what if you wish to insert multiple rows into a table and that data is not already in another DB2 table. In that case, you should use the LOAD utility. DB2 uses the LOAD utility to bulk load multiple rows into a table and it will be more efficient than a series of INSERT statements. Information on how to use the LOAD utility can be found in the IBM DB2 V7 manual named "Utility Guide and Reference" (SC26-9945) which can be downloaded from the IBM web site for free. http://www-3.ibm.com/software/data/db2/library/
This was first published in December 2002
Data Management Strategies for the CIO
Join the conversationComment
Share
Comments
Results
Contribute to the conversation