|
David, Yeah it works fine for me now and I'm got multiple files that use it and have never had a problem. So far it's been just one file that seems to have gotten confused. Charles Wilt -- iSeries Systems Administrator / Developer Mitsubishi Electric Automotive America ph: 513-573-4343 fax: 513-398-1121 > -----Original Message----- > From: midrange-l-bounces@xxxxxxxxxxxx > [mailto:midrange-l-bounces@xxxxxxxxxxxx]On Behalf Of Smith, Dave > Sent: Wednesday, August 03, 2005 1:24 PM > To: midrange-l@xxxxxxxxxxxx > Subject: Problem with GENERATED ALWAYS Identity column > > > Charles: > > Works fine for me. Tested on V5R3 > > I tried the following per your statements. (Added the constraint as a > secondary step but that should not matter. > > CREATE TABLE MyLIB.HPDOCU ( DHDOID INTEGER GENERATED ALWAYS AS > IDENTITY ( START WITH 1 INCREMENT BY 1 NO MINVALUE NO > MAXVALUE NO > CYCLE NO ORDER CACHE 20 ), DHCSCD CHAR(3) CCSID 37 NOT > NULL DEFAULT > '' , DHBRCH CHAR(13) CCSID 37 NOT NULL DEFAULT '' ); > alter table MyLIB.HPDOCU add CONSTRAINT > MyLIB.QSYS_HRDOCU_00001 PRIMARY > KEY( DHDOID ) ; > > insert into MyLIB.hpdocu (DHCSCD, DHBRCH) values('AAA', 'TestAAA'); > insert into MyLIB.hpdocu (DHCSCD, DHBRCH) values('BBB', 'TestBBB'); > insert into MyLIB.hpdocu (DHCSCD, DHBRCH) values('CCC', 'TestCCC'); > > Select * from MyLIB.hpdocu: > > 1 AAA TestAAA > 2 BBB TestBBB > 3 CCC TestCCC > > David Smith >
As an Amazon Associate we earn from qualifying purchases.
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.