|
Reeve wrote: > I though the "IDENTITY" value was table-specific, not global. Therefore, to > track changes from multiple tables in one "historical tracking" table, I'd > need to identify each tracking record by table and identity value. Check the SQL type ROWID, it is unique across all DB2 UDB for iSeries/zSeries . >From Information Center: A row ID is a value that uniquely identifies a row in a table. A column or a host variable can have a row ID data type. A ROWID column enables queries to be written that navigate directly to a row in the table. Each value in a ROWID column must be unique. The database manager maintains the values permanently, even across table reorganizations. When a row is inserted into the table, the database manager generates a value for the ROWID column unless one is supplied. If a value is supplied, it must be a valid row ID value that was previously generated by either DB2 UDB for OS/390 and z/OS or DB2 UDB for iSeries. The internal representation of a row ID value is transparent to the user. The value is never subject to CCSID conversion because it is considered to contain BIT data. The length attribute of a ROWID column is 40. Using ROWID is another way to have the system assign a unique value to a column in a table. ROWID is similar to identity columns, but rather than being an attribute of a numeric column, it is a separate data type. To create a table similar to the identity column example: CREATE TABLE ORDERS (ORDERNO ROWID GENERATED ALWAYS, SHIPPED_TO VARCHAR (36) , ORDER_DATE DATE) Bonne réception/Best regards Richard THEIS Education iSeries 400, Sce 8075, MTG 01.49.14.46.34 / Fax 01.43.04.59.85 theis_richard@xxxxxxxxxx
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.