<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - FIREBIRD : Migration : import of table with autoincrement leads to integrity violation when attempting to add new record"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=116982#c6">Comment # 6</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - FIREBIRD : Migration : import of table with autoincrement leads to integrity violation when attempting to add new record"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=116982">bug 116982</a>
              from <span class="vcard"><a class="email" href="mailto:robert@familiegrosskopf.de" title="robert@familiegrosskopf.de">robert@familiegrosskopf.de</a>
</span></b>
        <pre>(In reply to robert from <a href="show_bug.cgi?id=116982#c5">comment #5</a>)
<span class="quote">> This is the code for getting all generators:

> SELECT * FROM RDB$GENERATORS;

> ... but don't know the right generator.

> Could we save the name of the generator in the description of the field,
> which should be the autovalue-field?

> For HSQLDB you haven't to know this, because the code only need the table
> and the field.</span >

Have found this:
SELECT RDB$FIELD_NAME, RDB$RELATION_NAME, RDB$GENERATOR_NAME  FROM
RDB$RELATION_FIELDS WHERE RDB$GENERATOR_NAME IS NOT NULL

Will show the generatorname for the fields of the tables with autoincrement
value.

Generatornames are RDB$1, RDB$2 and so on ...
ALTER SEQUENCE RDB$1 RESTART WITH 10;
Sets the generator to 10. This should be the last value of the
autoincrement-field. Not the value, which should be generated as next value!
Next autoincremented value will be 11, when "RESTART WITH 10" is set - a little
bit confusing.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>