If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Insert multiple rows via script

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-04-09, 10:46
dbuser001 dbuser001 is offline
Registered User
 
Join Date: Jan 2008
Posts: 10
Insert multiple rows via script

Hello,

Would someone kindly show me a script that would insert multiple rows into a table? I am familiar with Oracle but not DB2. For example, I have a table with 5 columns and would like to insert 1000 rows with the same values except for the first column which ideally can be used as a variable. Any help is appreciated.

Thanks,
Reply With Quote
  #2 (permalink)  
Old 08-04-09, 11:33
Cougar8000 Cougar8000 is offline
Registered User
 
Join Date: Nov 2005
Location: IL
Posts: 554
It would help if you have listed your version and OS level. Consider what I did and put it in the signature.

Plus, why not download manuals and check them first.
__________________
--
IBM Certified DBA on DB2 for Linux, UNIX, and Windows

DB2 v9.1.0.2 os 5.3.0.0
Reply With Quote
  #3 (permalink)  
Old 08-04-09, 12:15
rdutton rdutton is offline
Registered User
 
Join Date: Dec 2008
Posts: 76
Either the LOAD statement or the IMPORT statement will do this. Look in the manuals for a full explanation, they are too complicated to explain here.

If you have questions once you have read the manuals, ask them here.
__________________
RD
Reply With Quote
  #4 (permalink)  
Old 08-04-09, 12:26
dbuser001 dbuser001 is offline
Registered User
 
Join Date: Jan 2008
Posts: 10
Thanks for getting back to me. It is V9.5 on OEL 5 update 3.
Reply With Quote
  #5 (permalink)  
Old 08-04-09, 12:38
Cougar8000 Cougar8000 is offline
Registered User
 
Join Date: Nov 2005
Location: IL
Posts: 554
Then you can download these manuals

IBM - DB2 Version 9.5 for Linux, UNIX and Windows English manuals

Check out Command center to be exact. Load and IMport. If you are only doing 5K you might want to look into Import first.
__________________
--
IBM Certified DBA on DB2 for Linux, UNIX, and Windows

DB2 v9.1.0.2 os 5.3.0.0
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On