You could get a UUID (Universally Unique IDentifier). This will give you a
unique ID that you could use.

D getUUID         PR                  ExtProc('_GENUUID') 
D  UUID_DS                        *   Value               

D UUID_DS         DS                                              
D  BytPrv                       10u 0 Inz(%size(UUID_DS))
D  BytAvl                       10u 0                             
D  Hold                          8a   Inz(*allx'00')            
D  UUID                         16a                               

C                   CallP     getUUID(%addr(UUID_DS))
C                   Eval      Key = UUID                   

-Kevin
-=-=-=-=-=-=-=-=-
Kevin R Mohondro
Programmer/Analyst
Ashworth, Inc

-----Original Message-----
From: Reeve Fritchman [mailto:reeve.fritchman@xxxxxxxxxx]
Sent: Monday, July 12, 2004 7:22 AM
To: 'Midrange Systems Technical Discussion'
Subject: Fastest way to get a unique identifier/tracking column changes


I'm designing a new system with a requirement for detailed tracking of, and
inquiry into, column-level changes.  I've decided to build a single file
with before and after values, etc. for all the tables by using triggers.
Some of the tables have complex keys (order number/SKU/shipper
location/consignee location/release number), and I don't want to burden my
historical tracking file with a nasty key structure to support inquiry into
the details of the changes.  I'm not going to track added records or
date-of-last-change timestamps in the tables; the majority of the changes
will be on a limited number of columns (of the status and date nature).

 

My design is to assign every row an "entity number"; the entity number would
be like a record serial number, would be unique on a system-wide basis, and
would be the key to the historical tracking table.  When a user wants to see
the details of the changes to a specific row, the row's entity number would
allow simple access to the tracking file.  Using SQL's AS IDENTITY with the
table name could work to provide a key to a specific record.

 

The challenge is to determine a way to get the entity number quickly.
Having a control file is okay but probably limiting performance-wise;
another possibility is a journaled data area.  Is there a system API
providing a guaranteed unique sequential number?  Or is there a better
approach for tracking column-level changes?

 

Thanks,

Reeve

 

 

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.

#####################################################################################
Attention:
The information contained in this message and or attachments is intended
only for the person or entity to which it is addressed and may contain
confidential and/or privileged material.  Any review, retransmission,
dissemination or other use of, or taking of any action in reliance upon,
this information by persons or entities other than the intended recipient
is prohibited. If you received this in error, please contact the sender and
delete the material from any system and destroy any copies.

Thank You.
#####################################################################################

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.