On 12/4/2015 3:59 PM, Rob wrote:

*** So does DB2 support INSERT INTO MyTable SET fld=val, fld=val
or only INSERT INTO MyTable ( Fields ) VALUES ( Values )

So I have spent almost 2 days fighting this one thing.

I don't want to sound callous, but what does the DB2 for i manual have
to say on the matter? I myself have posted a link several times. Here
it is again:
http://www-01.ibm.com/support/knowledgecenter/ssw_ibm_i_71/db2/rbafzintro.htm
(hint: the latter).


I have two very strong recommendations that I hope you will consider.

1) Start posting on MIDRANGE-L. I know for a fact that there are DB2
for i gurus who subscribe to that list /who are not subscribed to this
one/. You will get faster and probably better DB2 advice over there.

2) Bookmark or download the DB2 for i reference and use it often. Cut
and try is frustrating: I know first hand because I gave it up when
trying to move from DB2 to MySQL. And SQL Server.

I think I hear your actual question to be 'How to I find out the
auto-assigned ID?' If that's right:

SELECT IDENTITY_VAL_LOCAL() FROM MyTable
http://www-01.ibm.com/support/knowledgecenter/ssw_ibm_i_71/db2/rbafzscaidentity.htm

SELECT ID FROM FINAL TABLE( INSERT INTO MyLibrary.zTest
http://www-01.ibm.com/support/knowledgecenter/ssw_ibm_i_71/db2/rbafztabref.htm


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.