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 > How to Insert Records in a Loop

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-30-12, 11:29
eugenebalt eugenebalt is offline
Registered User
 
Join Date: Nov 2011
Posts: 8
How to Insert Records in a Loop

I need to insert a batch 5000 records into a table. Most of the fields will be the same for every record and can be hard-coded in the insert statement, except one which is a number field, and will be sequentially incremented from X to X+5000.

Is there a loop or another way to accomplish this? Thanks
Reply With Quote
  #2 (permalink)  
Old 01-30-12, 11:44
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
How about a sequence?
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