To add to my post just now - isn't it just so much easier to use a native RPG READ, then store the value, then bump it and UPDATE the record? This is where SQL seems to be the wrong approach - although doable, it's rather cumbersome.

Maybe!!

Vern

On 7/11/2012 4:48 PM, Raul A. Jager W. wrote:
I think there is a "SECUENCE" type of object in SQL, that increments in
1 each time it is used.

Other option is to create a view as "select max(usedkey) + 1 from your.file

Mike Wills wrote:

Stored procedures are not strong in this one.;-)

We have a "constant" file that holds the next sequence number for one of
our applications. I now need to access that from an external application. I
am hoping I can write a stored procedure to essentially

SELECT nextkey from CONSTANT
UPDATE CONSTANT SET nextkey = nextkey + 1

How would I put this one stored procedure?


--
Mike Wills
http://mikewills.me




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.