473,322 Members | 1,473 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

AS/400: generate unique numbers

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
8 2837
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Laphan | last post by:
Hi All This is a strange request, but I just cannot fathom how to do it. In theory the requirement is very basic, but in practise its a noodle!! I have 10 team names like so: Team A Team...
6
by: Sebastien | last post by:
Hi, I am building a products database, linking sales and production. Each part has a unique sales Stock Code and Production Number. The sales stock code is a combination of letters and numbers...
2
by: Chris Dunaway | last post by:
I have a web service which is accessed by a windows forms application. When the application submits a unit of work (a "job"), I want to return a job receipt or tracking number back to the...
6
by: Anamika | last post by:
I am doing a project where I want to generate random numbers for say n people.... These numbers should be unique for n people. Two people should not have same numbers.... Also the numbers...
1
by: Daniel Hilgarth | last post by:
Hello, I am currently trying to use XSLT for the creation of multiple HTML-files from a single XML-File. This HTML-files need to have links to each other. The following information might be...
8
by: Marc | last post by:
Hi all, I have to generate and send to a printer many 6 digit alphanumeric strings. they have to be unique but I cannot check in a database or something like that if it have already been printed....
24
by: pereges | last post by:
I need to generate two uniform random numbers between 0 and 1 in C ? How to do it ? I looked into rand function where you need to #define RAND_MAX as 1 but will this rand function give me ...
8
pradeepjain
by: pradeepjain | last post by:
i am creating a a form where in patients are registered and given a unique ID number(serial numbers) . and i need generate a pin number along with this id for him . which is the best way to generate...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.