Re: [firebird-support] reset autoincrement field

2016-12-03 Thread Helen Borrie hele...@iinet.net.au [firebird-support]
Nico Speleers wrote:

> How can I reset an autoincrement field in firebird 3 ? I used
> identity to make an autoincrement field.

In your Fb 3 installation is the /doc/ directory, where you will find
the release notes in PDF form.  IDENTITY is documented on page 69
(page 79 by the PDF numbering), including the syntax for making the
(otherwise inaccessible) generator restart with a different value.

Syntax works ONLY with an IDENTITY column.

To re-initialise to zero:

alter table aTable
alter column aTable_ID RESTART

The next number generated will be 1.

To re-intialise to some other number:

alter table aTable
alter column aTable_id RESTART WITH n

The next number generated will be (n+1).

Remember to COMMIT if you are not using isql with autoddl on.

HB



RE: [firebird-support] reset autoincrement field

2016-12-02 Thread 'Zoran' zoran...@gmail.com [firebird-support]
IDENTITY in FB3 uses the same logic as previous versions (trigger and
generator), only it is hidden from the user. Behind the scenes it is doing
that.

 

If you don't find the better solution, here is how you can get generator
name for the Primary Key (IDENTITY):

(change CUSTOMER to your table name)

 

SELECT g.RDB$GENERATOR_NAME

FROM RDB$RELATION_FIELDS AS g

WHERE g.RDB$RELATION_NAME = 'CUSTOMER'

AND g.RDB$FIELD_NAME = (SELECT f.rdb$field_name

FROM rdb$index_segments AS f

LEFT JOIN rdb$relation_constraints AS rc ON
(rc.rdb$index_name = f.rdb$index_name)

WHERE rc.rdb$relation_name = 'CUSTOMER'

AND rc.rdb$constraint_type = 'PRIMARY KEY')

 

 

 

 

From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] 
Sent: Friday, December 2, 2016 10:37 AM
To: firebird-support@yahoogroups.com
Subject: RE: [firebird-support] reset autoincrement field

 

  

I only use the property Identity to make an autoincrement field and I don't
make use of generators. Therefore 'How can I reset an autoincrement field in
firebird 3 ? I used identity to make an autoincrement field' ?

Nico Speleers
Analyst

Carfac bvba

Driving on experience

Rijksweg 53
9680 Maarkedal
Tel. +32 55 23 00 00
Fax +32 55 31 00 95
nico.spele...@carfac.com
www.carfac.be<http://www.carfac.be/>
[cid:image001.jpg@01D11613.C23F19C0]<http://www.facebook.com/groups/12070918
1286476/>[cid:image002.jpg@01D11613.C23F19C0]<http://www.linkedin.com/compan
y/hdc-software-nv> [cid:image003.jpg@01D11613.C23F19C0]
<https://twitter.com/carfacbvba>

[Beschrijving: Beschrijving: Beschrijving: CarfacAS
(klein)]<http://www.carfac.be/>

Van: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com]
Verzonden: vrijdag 2 december 2016 16:34
Aan: firebird-support@yahoogroups.com
Onderwerp: RE: [firebird-support] reset autoincrement field

To see current generator value

select gen_id(generator-name, 0) from rdb$database

To set generator value

set generator generator-name to value;

From:
firebird-support@yahoogroups.com<mailto:firebird-support@yahoogroups.com>
[mailto:firebird-support@yahoogroups.com]
Sent: Friday, December 2, 2016 10:13 AM
To:
firebird-support@yahoogroups.com<mailto:firebird-support@yahoogroups.com>
Subject: [firebird-support] reset autoincrement field

How can I reset an autoincrement field in firebird 3 ? I used identity to
make an autoincrement field.

Thanks.

Nico Speleers
Analyst

Carfac bvba

Driving on experience

Rijksweg 53
9680 Maarkedal
Tel. +32 55 23 00 00
Fax +32 55 31 00 95
nico.spele...@carfac.com<mailto:nico.spele...@carfac.com>
www.carfac.be<http://www.carfac.be/<http://www.carfac.be%3chttp:/www.carfac.
be/>>
[cid:image001.jpg@01D11613.C23F19C0]<http://www.facebook.com/groups/12070918
1286476/>[cid:image002.jpg@01D11613.C23F19C0]<http://www.linkedin.com/compan
y/hdc-software-nv> [cid:image003.jpg@01D11613.C23F19C0]
<https://twitter.com/carfacbvba>

[Beschrijving: Beschrijving: Beschrijving: CarfacAS
(klein)]<http://www.carfac.be/>

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]





[Non-text portions of this message have been removed]



RE: [firebird-support] reset autoincrement field

2016-12-02 Thread Nico Speleers - Carfac BVBA nico.spele...@carfac.com [firebird-support]
I only use the property Identity to make an autoincrement field and I don't 
make use of generators. Therefore 'How can I reset an autoincrement field in 
firebird 3 ? I used identity to make an autoincrement field' ?

Nico Speleers
Analyst





Carfac bvba

Driving on experience


Rijksweg 53
9680 Maarkedal
Tel. +32 55 23 00 00
Fax +32 55 31 00 95
nico.spele...@carfac.com
www.carfac.be<http://www.carfac.be/>
[cid:image001.jpg@01D11613.C23F19C0]<http://www.facebook.com/groups/120709181286476/>[cid:image002.jpg@01D11613.C23F19C0]<http://www.linkedin.com/company/hdc-software-nv>
 [cid:image003.jpg@01D11613.C23F19C0] <https://twitter.com/carfacbvba>

[Beschrijving: Beschrijving: Beschrijving: CarfacAS 
(klein)]<http://www.carfac.be/>



Van: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com]
Verzonden: vrijdag 2 december 2016 16:34
Aan: firebird-support@yahoogroups.com
Onderwerp: RE: [firebird-support] reset autoincrement field


To see current generator value

select gen_id(generator-name, 0) from rdb$database

To set generator value

set generator generator-name to value;



From: firebird-support@yahoogroups.com<mailto:firebird-support@yahoogroups.com> 
[mailto:firebird-support@yahoogroups.com]
Sent: Friday, December 2, 2016 10:13 AM
To: firebird-support@yahoogroups.com<mailto:firebird-support@yahoogroups.com>
Subject: [firebird-support] reset autoincrement field



How can I reset an autoincrement field in firebird 3 ? I used identity to make 
an autoincrement field.

Thanks.

Nico Speleers
Analyst

Carfac bvba

Driving on experience

Rijksweg 53
9680 Maarkedal
Tel. +32 55 23 00 00
Fax +32 55 31 00 95
nico.spele...@carfac.com<mailto:nico.spele...@carfac.com>
www.carfac.be<http://www.carfac.be/<http://www.carfac.be%3chttp:/www.carfac.be/>>
[cid:image001.jpg@01D11613.C23F19C0]<http://www.facebook.com/groups/120709181286476/>[cid:image002.jpg@01D11613.C23F19C0]<http://www.linkedin.com/company/hdc-software-nv>
 [cid:image003.jpg@01D11613.C23F19C0] <https://twitter.com/carfacbvba>

[Beschrijving: Beschrijving: Beschrijving: CarfacAS 
(klein)]<http://www.carfac.be/>

[Non-text portions of this message have been removed]



[Non-text portions of this message have been removed]



RE: [firebird-support] reset autoincrement field

2016-12-02 Thread 'Zoran' zoran...@gmail.com [firebird-support]
To see current generator value

 

select gen_id(generator-name, 0) from rdb$database

 

To set generator value

 

set generator generator-name to value;

 



 

From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] 
Sent: Friday, December 2, 2016 10:13 AM
To: firebird-support@yahoogroups.com
Subject: [firebird-support] reset autoincrement field

 

  

How can I reset an autoincrement field in firebird 3 ? I used identity to
make an autoincrement field.

Thanks.

Nico Speleers
Analyst

Carfac bvba

Driving on experience

Rijksweg 53
9680 Maarkedal
Tel. +32 55 23 00 00
Fax +32 55 31 00 95
nico.spele...@carfac.com <mailto:nico.spele...@carfac.com> 
www.carfac.be <http://www.carfac.be%3chttp:/www.carfac.be/>
<http://www.carfac.be/>
[cid:image001.jpg@01D11613.C23F19C0]<http://www.facebook.com/groups/12070918
1286476/>[cid:image002.jpg@01D11613.C23F19C0]<http://www.linkedin.com/compan
y/hdc-software-nv> [cid:image003.jpg@01D11613.C23F19C0]
<https://twitter.com/carfacbvba>

[Beschrijving: Beschrijving: Beschrijving: CarfacAS
(klein)]<http://www.carfac.be/>

[Non-text portions of this message have been removed]





[firebird-support] reset autoincrement field

2016-12-02 Thread Nico Speleers - Carfac BVBA nico.spele...@carfac.com [firebird-support]
How can I reset an autoincrement field in firebird 3 ? I used identity to make 
an autoincrement field.

Thanks.

Nico Speleers
Analyst





Carfac bvba

Driving on experience


Rijksweg 53
9680 Maarkedal
Tel. +32 55 23 00 00
Fax +32 55 31 00 95
nico.spele...@carfac.com
www.carfac.be
[cid:image001.jpg@01D11613.C23F19C0][cid:image002.jpg@01D11613.C23F19C0]
 [cid:image003.jpg@01D11613.C23F19C0] 

[Beschrijving: Beschrijving: Beschrijving: CarfacAS 
(klein)]





[Non-text portions of this message have been removed]