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



v7r2 has an enhancement to the timestamp that allows 12 digits to be defined for the "microsecond"
As an aside:
Timestamps with up to 12 digits can only be managed in SQL described tables, views or indexes, but cannot be defined within DDS described physical or logical files
... but all 12 digits for the micro seconds are only filled when using the SQL Special Register Current_Timestamp(12). When performing the write or update with native I/O as before only the first 3 digits are filled

Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them and keeping them!"

-----Ursprüngliche Nachricht-----
Von: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im Auftrag von Dan
Gesendet: Wednesday, 15.7 2015 20:51
An: RPG programming on the IBM i (AS/400 and iSeries)
Betreff: Re: duplicate key error in identity column

Luis,

Not too long ago, Chuck Pence pointed out that v7r2 has an enhancement to the timestamp that allows 12 digits to be defined for the "microsecond" and that IBM documentation seems to indicate that can be used as a unique value across the entire system.

http://archive.midrange.com/midrange-l/201504/msg00525.html

- Dan

On Wed, Jul 15, 2015 at 1:58 PM, Luis Rodriguez <luisro58@xxxxxxxxx> wrote:

Dale,

Personally, I would advise against using a timestamp as a unique key field.
If either the program and/or the box is fast enough a timestamp can be
duplicated across consecutive records.

Regards,

Luis

Luis Rodriguez
IBM Certified Systems Expert — eServer i5 iSeries
--

On Wed, Jul 15, 2015 at 1:20 PM, Dale Janus
<dalejanus@xxxxxxxxxxxxxxxxx>
wrote:

Everyone,

The logical file with the two fields omitted makes the most sense.
But I am trying to create a timestamp based on data in the original
file.
In an incredible stroke of far-sightedness for something created
over 20 years ago, the original file had an 8 digit date and 6 digit
time. I
want
to carry those over as a time stamp. ILE RGP is pretty handy to
convert
my
digits into time and date, and then just add them together to
create the time stamp.
So I will create a logical with just the id omitted, let the program
create the time stamp and see how far I get.

Thanks for the suggestions. I'll report back what works.
---Dale

--
This is the RPG programming on the IBM i (AS/400 and 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 ...

Follow-Ups:
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.