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 > Multiple inserts

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-20-09, 12:53
MarcinD MarcinD is offline
Registered User
 
Join Date: Jan 2008
Location: Warsaw
Posts: 6
Multiple inserts

Hi all,
Have u ever used multiple insert features of DB2 ?
DB2 V8 - Planning for Version 8 - Multiple-row INSERT and FETCH statements
I've tried to use it with indexed table but got error. I've noticed that multiple insert - an sample:
Code:
EXEC SQL
   INSERT INTO TABLENAME 
   (
     COL1, 
     COL2
   )
   VALUES 
   (
    :VAR-COL1, 
    :VAR-COL2
   )
   FOR :NUM-ROWS ROWS
END-EXEC.
works fine when table is declared:
Code:
05 VAR-COL1        OCCURS 5 TIMES PIC X(10)
05 VAR-COL2        OCCURS 5 TIMES PIC X(8)
but when is declared:
Code:
05 VAR            OCCURS 5 TIMES.
   10 VAR-COL1        PIC X(10).
   10 VAR-COL2        PIC X(8).
or
Code:
05 VAR            OCCURS 5 TIMES INDEXED BY IDX.
   10 VAR-COL1        PIC X(10).
   10 VAR-COL2        PIC X(8).
then it doesnt work. Maybe someone have more experience with this ?

--
Marcin Domaslawski
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