OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Reseting the primary key

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base
View previous topic :: View next topic  
Author Message
kptan
Newbie
Newbie


Joined: 18 Aug 2006
Posts: 4
Location: Malaysia

PostPosted: Mon Nov 06, 2006 7:46 am    Post subject: Reseting the primary key Reply with quote

okie i have a primary key which is jobID and its auto. but some documents which i keyed in, i want to remove it. lets say jobID #24. but the next number will be #25 and not #24. or if i keyed in like 3 datas and delete em all, the latest jobID would be #4. doesnt it start with zero again? Embarassed

Thanx
Back to top
View user's profile Send private message MSN Messenger
audionuma
OOo Enthusiast
OOo Enthusiast


Joined: 23 Feb 2006
Posts: 126
Location: France

PostPosted: Mon Nov 06, 2006 11:59 am    Post subject: Reply with quote

hello,
with Tools > SQL ... you can execute the following instruction :
Code:
ALTER TABLE "myTable" ALTER COLUMN "myIdentityPrimaryKey" RESTART WITH 0

0 or any integer that fits your needs ...
Just be careful if that primary key is used as a foreign key in an other table ...
_________________
OOo 2.3 / Mac OS PPC X.4.11
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group