This is a discussion on AS/400: generate unique numbers within the DB2 forums, part of the Database Server Software category; --> It seems that on AS/400, the IDENTITY option is not available. For example, I cannot declare a column as ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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! |
| |||
| deebeetwo@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 |
| |||
| Anton Versteeg wrote: > deebeetwo@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 |
| |||
| deebeetwo@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 |
| |||
| 4.spam@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. |
| |||
| 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 |
| |||
| deebeetwo@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 |
| ||||
| You can configure it to use RRN or Relative Record Number. Thanks, RdR <deebeetwo@yahoo.com> wrote in message news:1123737015.796194.110330@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! > |
| Thread Tools | |
| Display Modes | |
|
|