View previous topic :: View next topic |
Author |
Message |
cyberuser Beginner
Joined: 15 Oct 2005 Posts: 29 Topics: 12
|
Posted: Mon Jul 06, 2009 9:39 pm Post subject: Multi Row Insert via QMF |
|
|
i tried to use the following statement on qmf and it worked fine.
INSERT INTO table (name, address)
values ('john doe', 'street one')
but when using :
INSERT INTO table (name, address)
values ('john doe', 'street one'),
values ('mary doe', 'street two')
i
t didn't work... Any suggested workaround to include multiples recs into the table? |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Mon Jul 06, 2009 9:58 pm Post subject: |
|
|
cyberuser,
Try this untested sql
Code: |
INSERT INTO Table (name, address) FOR 2 ROWS
VALUES ('john doe', 'street one' ,'mary doe', 'street two')
ATOMIC;
|
|
|
Back to top |
|
 |
cyberuser Beginner
Joined: 15 Oct 2005 Posts: 29 Topics: 12
|
Posted: Mon Jul 06, 2009 10:14 pm Post subject: |
|
|
it seems it's not recognizing the "2" .... from statement FOR 2 ROWS... |
|
Back to top |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Tue Jul 07, 2009 2:44 am Post subject: |
|
|
is crap. try providing sqlcode next time with dsntair output
newer versions of db2 allow for multiple VALUES but the syntax is with only one VALUES phrase. look-up the syntax, I know the manual provides an example.
if you are on an older version of db2, try using UNION:
INSERT INTO Table (name, address)
values (jdjdj,djdjdj)
UNION
<work out what you have to do here>
and it is ROWS not records. and stop abbreviating, this is not a chat room. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
 |
|
|