× 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.



How did you "add the Identity column manually"?

The link is to DB2UDB for platforms other than i5OS. Stick to i5
infocenter for i5 database specifics. Although there are similarities
they are different in many details.

You need the "including ..." clause in your create table statement to
have the new identity column created as an identity column from the
referenced identity column.

But it sounds like you are choosing to use sequence instead of
identity column anyway.


On 9/27/07, David Foxwell <david.foxwell@xxxxxxxxx> wrote:
Thanks for this Brian,

I can't pur the identity column in the reference file as it is a DDS file. I
tried creating the table as a result from 2 tables,

eg create table T as ( select id from SQLtable, name from DDSfile)

But the column id loses its identity.

In the end I added the Identity column manually.

Just one problem : this page :
http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.
db2.udb.doc/admin/c0004994.htm it says I can't do that, but it seems I have
already. What have I missed?

Now, I have discovered sequences. Using a sequence instead of an identity
lets me forget the identity column that I can't put in the DDS reference
file.


From: "Brian Johnson" <brian.johnson.mn@xxxxxxxxx>


Column defined in "field reference table":

create table ref-table-name ...
primary_key_oid for pk_oid integer not null generated always
as identity
(cycle) ...



Column defined in a table using the reference table:

create table table-name
( priKey , ... )
as ( select primary_key_oid , ...
from ref-table-name )
definition only
including identity column attributes
including column defaults





--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.





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.