dbTalk Databases Forums  

Adjusting the IDENTITY next-value counter in version 7?

comp.databases.ibm-db2 comp.databases.ibm-db2


Discuss Adjusting the IDENTITY next-value counter in version 7? in the comp.databases.ibm-db2 forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Troels Arvin
 
Posts: n/a

Default Adjusting the IDENTITY next-value counter in version 7? - 08-12-2010 , 08:30 AM






Hello,

In a generation 7 DB2 database, I need to adjust the counter for the next
GENERATED ALWAYS AS IDENTITY value for a table. But I can't make it work:

db2 "ALTER TABLE remindervalue ALTER COLUMN id RESTART WITH 923"

DB21034E The command was processed as an SQL statement because it was
not a valid Command Line Processor command. During SQL processing it
returned:
SQL0104N An unexpected token "RESTART WITH 923" was found following "ALUE
ALTER COLUMN id". Expected tokens may include: "<space>". SQLSTATE=42601

db2level
DB21085I Instance "db2inst1" uses DB2 code release "SQL07010" with level
identifier "02010105" and informational tokens "DB2 v7.1.0", "s000510"
and "".

How are such counters adjusted in DB2 generation 7?

(And please don't bully me regarding the old software which I currently
have to work with...)

--
Troels

Reply With Quote
  #2  
Old   
Troels Arvin
 
Posts: n/a

Default Re: Adjusting the IDENTITY next-value counter in version 7? - 08-12-2010 , 09:57 AM






Hello,

Earlier, I wrote:
Quote:
In a generation 7 DB2 database, I need to adjust the counter for the
next GENERATED ALWAYS AS IDENTITY value for a table. But I can't make it
work
[...]

I installed FP3 for DB2 v. 7.1, and then the "ALTER TABLE ... ALTER
COLUMN ... RESTART ..." syntax worked.

--
Troels

Reply With Quote
  #3  
Old   
Serge Rielau
 
Posts: n/a

Default Re: Adjusting the IDENTITY next-value counter in version 7? - 08-12-2010 , 10:57 AM



On 8/12/2010 10:57 AM, Troels Arvin wrote:
Quote:
Hello,

Earlier, I wrote:
In a generation 7 DB2 database, I need to adjust the counter for the
next GENERATED ALWAYS AS IDENTITY value for a table. But I can't make it
work
[...]

I installed FP3 for DB2 v. 7.1, and then the "ALTER TABLE ... ALTER
COLUMN ... RESTART ..." syntax worked.

I think 7.1 FP3 = 7.2. Seems like we added it then. That's a loooong
time ago.


--
Serge Rielau
SQL Architect DB2 for LUW
IBM Toronto Lab

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.