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

AS/400: generate unique numbers

P: n/a
It seems that on AS/400, the IDENTITY option is not available. For
example, I cannot declare a column as "integer generated always as
identity".

Is there an alternative that I can use? The numbers that I would like
generated do not need to be sequential.

Thanks in advance!

Nov 12 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
Hello.

You can do it since V5R2.
What version do you use?
If your as/400 version is older write c (or java, or etc...) udf
generating unique value and use it in before trigger.

Sincerely,
Mark B.

Nov 12 '05 #2

P: n/a
de*******@yahoo.com wrote:
It seems that on AS/400, the IDENTITY option is not available. For
example, I cannot declare a column as "integer generated always as
identity".

Is there an alternative that I can use? The numbers that I would like
generated do not need to be sequential.

Thanks in advance!

What version are you on?
If I am correct identity values are supported since V5R3

--
Anton Versteeg
IBM Netherlands
Nov 12 '05 #3

P: n/a
Anton Versteeg wrote:
de*******@yahoo.com wrote:
It seems that on AS/400, the IDENTITY option is not available. For
example, I cannot declare a column as "integer generated always as
identity".

Is there an alternative that I can use? The numbers that I would like
generated do not need to be sequential.

Thanks in advance!

What version are you on?
If I am correct identity values are supported since V5R3

Correction: Since V5R2

--
Anton Versteeg
IBM Netherlands
Nov 12 '05 #4

P: n/a
de*******@yahoo.com wrote:
It seems that on AS/400, the IDENTITY option is not available. For
example, I cannot declare a column as "integer generated always as
identity".

Is there an alternative that I can use? The numbers that I would like
generated do not need to be sequential.

DB2 for iSeries does support IDENTITY. Maybe you are on a backlevel version?

Cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #5

P: n/a
4.****@mail.ru wrote:
Hello.

You can do it since V5R2.
What version do you use?
If your as/400 version is older write c (or java, or etc...) udf
generating unique value and use it in before trigger.
Interestingly enough, it is Version 5 Release 1! I will see what it
takes to write a udf and use it in statements.

Thanks a lot!

Sincerely,
Mark B.


Nov 12 '05 #6

P: n/a
Serge Rielau wrote:
DB2 for iSeries does support IDENTITY. Maybe you are on a backlevel version?
You are absolutely right. I talked to the admin guy and the version is
indeed V5R1. (By the way, is there a way to find this out from the
system itself directly?)

As another poster suggested, an option is to use a UDF written in
C/Java. In that case, could I use the call to that function in an
Insert or Select statements?
Cheers
Serge


Nov 12 '05 #7

P: n/a
de*******@yahoo.com wrote:
Serge Rielau wrote:
DB2 for iSeries does support IDENTITY. Maybe you are on a backlevel version?

You are absolutely right. I talked to the admin guy and the version is
indeed V5R1. (By the way, is there a way to find this out from the
system itself directly?)


One way to determine the OS version/release:
- On a command line run: go licpgm
- Pick option: Display installed licensed programs
- Use function key for: Display release (eg F11)

--
Karl Hanson
Nov 12 '05 #8

P: n/a
RdR
You can configure it to use RRN or Relative Record Number.

Thanks,

RdR
<de*******@yahoo.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
It seems that on AS/400, the IDENTITY option is not available. For
example, I cannot declare a column as "integer generated always as
identity".

Is there an alternative that I can use? The numbers that I would like
generated do not need to be sequential.

Thanks in advance!

Nov 12 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.