Loading ...
Sorry, an error occurred while loading the content.

Re: [IBO] Change pri key data type to auto increment

Expand Messages
  • Thomas Steinmaurer
    ... There is no auto-increment data type in InterBase/Firebird. This is done differently in IB/FB, namely with a generator and a BEFORE INSERT trigger. Look
    Message 1 of 3 , Jun 14, 2012
    View Source
    • 0 Attachment
      > I created my tables without specifying automatic numbering (incrementing) of key fields (type integer). I now want to go back and fix that. Here is what I am using in IB_SQL:
      >
      > alter table units alter column kunit auto_number primary key
      >
      > IB does not like the data type. Literature refers to autonumber and auto_increment. Those don't work either.

      There is no auto-increment data type in InterBase/Firebird. This is done
      differently in IB/FB, namely with a generator and a BEFORE INSERT
      trigger. Look here for an example: http://www.firebirdfaq.org/faq29/

      --
      With regards,
      Thomas Steinmaurer
      http://www.upscene.com/
    • IBO Support List
      You may need to temporarily drop (inactivate) triggers and create a temporary column for that and put the values in there and then drop that column and add it
      Message 2 of 3 , Aug 5, 2013
      View Source
      • 0 Attachment
        You may need to temporarily drop (inactivate) triggers and create a
        temporary column for that and put the values in there and then drop that
        column and add it back in and then copy over the values and then drop the
        temporary column and reactivate the triggers.

        Jason

        -----Original Message-----
        From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On Behalf
        Of jwcane2003
        Sent: Thursday, June 14, 2012 1:37 PM
        To: IBObjects@yahoogroups.com
        Subject: [IBO] Change pri key data type to auto increment

        I created my tables without specifying automatic numbering (incrementing) of
        key fields (type integer). I now want to go back and fix that. Here is what
        I am using in IB_SQL:

        alter table units alter column kunit auto_number primary key

        IB does not like the data type. Literature refers to autonumber and
        auto_increment. Those don't work either.

        How is this done?




        ------------------------------------

        ___________________________________________________________________________
        IB Objects - direct, complete, custom connectivity to Firebird or InterBase
        without the need for BDE, ODBC or any other layer.
        ___________________________________________________________________________
        http://www.ibobjects.com - your IBO community resource for Tech Info papers,
        keyword-searchable FAQ, community code contributions and more !
        Yahoo! Groups Links
      Your message has been successfully submitted and would be delivered to recipients shortly.