Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2004

    Unanswered: A little help about 'GENERATE ALWAYS', please !

    Hi all,

    When creating a 'generated always' columns is it possible to have values like "ID0001", "ID0002", "ID0003" and so on ?! If so, how ?

    Obs.: This column shall be my PRIMARY KEY.

    Thanks in advance.

  2. #2
    Join Date
    Jan 2004
    Europe, Finland, Helsinki
    Hi Arrebola!

    Sorry, "GENERATED ALWAYS" columns are allways SMALLINT, INTEGER or DECIMAL. So it's not possible to use CHAR datatype. So, anwer is no!

    We have used GENERATED ALWAYS columns and we considered those to be a big mistake. The maintanance with GENERATED ALWAYS tables is really "pain in the neck".
    Tables with GENERATED BY DEFAULT is somewhat easier to maintain - but not ideal either. If you have version 8 with SEQUENCEs, use those instead.

    Cheers, Bill

  3. #3
    Join Date
    Aug 2004
    you ca have oe colum say C1 as generated always as identity(int), and second colum c2 as generated always as ('I000' || c1). form proper concatenation expression for this column

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts