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
Posted by: Helen Borrie <helebor@iinet.net.au>
| Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (6) |
Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu. Try FAQ and other links from the left-side menu there.
Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
No comments:
Post a Comment