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