× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Right, and in C it might be an array of structs. So it looks like a nost variable or host structure can do this? Then why not the syntax described below? Other DB2 flavors let you have multiple rows defined in the VALUES clause - iSeries does not.

Vern

At 11:27 AM 6/12/2003 -0500, you wrote:
Vern,

You can do it if the SQL is embedded in a program.  I know you code mostly C
but in RPG you would use a multiple occurrence data structure.

Rick

-----Original Message-----
From: Vern Hamberg [mailto:vhamberg@xxxxxxxxxxxxxxxxxxxxxxxxx]
Sent: Thursday, June 12, 2003 8:21 AM
To: midrange Systems Technical Discussion
Subject: Multi-row insert in SQL

Anyone know if or when iSeries SQL will have a multi-row INSERT?

INSERT INTO tab_comp VALUES     (item1, price1, qty1),
                                 (item2, price2, qty2),
                                 (item3, price3, qty3)

instead of

INSERT INTO tab_comp VALUES (item1, price1, qty1)
INSERT INTO tab_comp VALUES (item2, price2, qty2)
INSERT INTO tab_comp VALUES (item3, price3, qty3)

It's in other flavors of DB2, as well as the SQL-92 standard.

Vern



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.