473,386 Members | 1,793 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,386 software developers and data experts.

How to reset auto generated id in a DB2 table

Hi
Is there a way to reset the auto generated id for this table. Drop
table and recreating does not work.
Jun 27 '08 #1
2 8458
<an******@gmail.comwrote in message
news:eb**********************************@i18g2000 prn.googlegroups.com...
Hi
Is there a way to reset the auto generated id for this table. Drop
table and recreating does not work.
If you have DB2 for LUW, the information you want is in the SQL Reference
Vol 2, under ALTER TABLE. Look at the ALTER COLUMN section and the "RESTART
WITH n" clause.

If you have DB2 for z/OS the SQL Reference is in a single volume (last time
I checked).

If you don't have a SQL Reference manual, you can download a searchable PDF
version for free.
Jun 27 '08 #2
Mark A wrote:
<an******@gmail.comwrote in message
news:eb**********************************@i18g2000 prn.googlegroups.com...
>Hi
Is there a way to reset the auto generated id for this table. Drop
table and recreating does not work.

If you have DB2 for LUW, the information you want is in the SQL Reference
Vol 2, under ALTER TABLE. Look at the ALTER COLUMN section and the "RESTART
WITH n" clause.

If you have DB2 for z/OS the SQL Reference is in a single volume (last time
I checked).

If you don't have a SQL Reference manual, you can download a searchable PDF
version for free.

And if you have DB2 for i5/OS (also supports ALTER .. RESTART WITH n),
the SQL Reference is here:
http://publib.boulder.ibm.com/infoce...ode=int_213704

--
Karl Hanson
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Earl Anderson | last post by:
KB Article Q140908 provided the following function to create an Auto Incrementing Counter: Function Next_Custom_Counter () On Error GoTo Next_Custom_Counter_Err Dim MyDB As Database Dim...
16
by: John Baker | last post by:
Hi: I know this is a strange question, but I have inherited a system where files are copied and records re auto numbered (as an index field) )frequently, and I am wondering how high the number...
3
by: trueblue7 | last post by:
I apologize if this question has been asked before... I'm trying to reset autonumber fields back to 1. The autonumber fields are part of the composite primary keys. I followed the MS help with...
6
by: Alpha | last post by:
I retrieve a table with only 2 columns. One is a auto-generated primary key column and the 2nd is a string. When I add a new row to the dataset to be updated back to the database. What should I...
0
by: Viorel | last post by:
Working as a beginner with data objects in Visual Studio 2003 and C#, I use the "Generate Dataset" command in order to generate automatically the dataset objects based on data adapters. Generated...
9
by: danielbuus | last post by:
Hey there :) I'm using Ruby on Rails to create a migration of a legacy database on an MS SQL Server. I'd like to name my constraints myself, such as 'pk_authors', but in the cases where a table...
8
by: Wayne L | last post by:
I have searched and could not find my solution to my problem. I have a table that has a field that I want to start at 0001 and go to 1999. Once it reaches 1999 I want the field to reset to 0001. I...
9
zimes
by: zimes | last post by:
I am working with Microsoft Access 2003 from the Office XP pro suite. I have created several tables that have to do with Asset tracking along with purchasing. I have a table called Purchasing,...
0
by: Frank Swarbrick | last post by:
>>On 6/10/2008 at 4:30 PM, in message <ebf88f96-d8b0-4dfc-85ed-a3a5c44ae4dd@i18g2000prn.googlegroups.com>, <anuritab@gmail.comwrote: Seems like that would work, unless you are actually using a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.