By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,155 Members | 2,518 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,155 IT Pros & Developers. It's quick & easy.

Increment a number field

P: n/a
I converted to a DB2 database where the data type was changed from
autonumber to number field. I still need to increment the field by one
each time a new record is added. Can anyone help me?

Thanks
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Jim Bowe" <ja**********@wellsfargo.com> wrote in message
news:17**************************@posting.google.c om...
I converted to a DB2 database where the data type was changed from
autonumber to number field. I still need to increment the field by one
each time a new record is added. Can anyone help me?


Our ISeries flavor of DB2 (UDB) supports an auto-incrementing feature for
numeric columns. Are you sure yours doesn't? Otherwise you can use a
BeforeInsert Trigger to find the highest existing value and increment by 1. I
use that in a few tables I created before the Auto-Increment feature was added.

You can also just use code in your front end to assign the value using a similar
method as the trigger.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.