Does the RESTART_IDENTITY procedure solve your problem?

http://www-01.ibm.com/support/knowledgecenter/ssw_ibm_i_72/rzajq/rzajqprocrestartidentity.htm


date: Mon, 25 Jan 2016 12:40:27 -0300
from: Raul A Jager W <raul@xxxxxxxxxx>
subject: Auto increment Key

I have several files (tables) that have a field defined as auto
increment.

When I make a copy the new file works fine, but if I add records to the
original and pass them to the new file using "CPYF *UPDADD" both files
become identical, but if I insert a new row in the copy, it uses the
auto-increment from the time I created the file.
"Alter table" fixes the problem, but I wish there is a "more automatic"
way to synchronize the restart for the auto-increment field in the new
file.

Any experience? Ideas?

TIA
Ra?l

-- Este e-mail fue enviado desde el Mail Server del diario ABC Color --
-- Verificado por Anti-Virus Corporativo Symantec --



Sue Romano
IBM i SQL Development



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.