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

[SOLVED] Multi-mode database - adding autoincrement

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


Joined: 11 Mar 2012
Posts: 5

PostPosted: Wed Apr 11, 2012 11:37 pm    Post subject: [SOLVED] Multi-mode database - adding autoincrement Reply with quote

Hi,

I am using a Multi-mode database. In one table, my identity field suddenly does not autoincrement anymore. After I checked it, the AutoValue option is set to NO.

How can I reset it to YES and restart at , say, 1000 ?
(something like alter table "table" alter column "ID " autovalue = true ) ?


Last edited by Vodoley3 on Thu Apr 12, 2012 12:07 am; edited 1 time in total
Back to top
View user's profile Send private message
probe1
Moderator
Moderator


Joined: 18 Aug 2004
Posts: 2465
Location: Chonburi Thailand Asia

PostPosted: Wed Apr 11, 2012 11:48 pm    Post subject: Re: Multi-mode database - adding autoincrement Reply with quote

Vodoley3 wrote:
I am using a Multi-mode database.


Syntax depends on database you use. See the documentation there.


For OOo-BASE embedded HSQLDB ( v1.8 )

Reset to a number
Code:
alter table "Tabelle1" alter column "id" restart with  1000


re-assign autoincrement
Code:
alter table "Tabelle1" alter column "id"  identity

_________________
Cheers
Winfried
My Macros
DateTime2 extension: insert date, time or timestamp, formatted to your needs
Back to top
View user's profile Send private message Visit poster's website
dacm
Super User
Super User


Joined: 07 Jan 2010
Posts: 734

PostPosted: Thu Apr 12, 2012 2:56 am    Post subject: Reply with quote

Obviously solved, but just for the record, this AutoValue issue is one of several other 'frozen properties' issues mentioned in the tutorial as cited in summary here:
Setting AutoValue keys in Server Mode
_________________
Soli Deo gloria
Tutorial: avoiding data loss with Base + Migrating 'Embedded databases'
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