Switch to: V9V8V7V6V5

Valentina Example: Enums

This example provides you with a demonstration of using enum types in Valentina DB:

Structure of the table

This database contains one table with short description of the cars. The table contains four fields:

  • fldManufacturer – name of manufacturer
  • fldModel – type of car model
  • fldYear – year of manufacture
  • fldColor – color of the car

The enum type Color contains names of colors in English, as well as two additional localizations:

  • en – for representation of colors on English (native for database)
  • de – for representation of colors on German
  • ru – for representation of colors on Russian

The query for creating this type:

CREATE OR REPLACE TYPE Colors AS ENUM8  
        ( 'Black'  , 'Blue' , 'Brown'     , 'Gold'   , 'Gray' , 'Green'  , 'Magenta'  , 'Pink'   , 'Purple'    , 'Red'    , 'Silver'     , 'White', 'Yellow' ),
'de':	( 'Schwarz', 'Blau' , 'Braun'     , 'Gold'   , 'Grau' , 'Grün'   , 'Magenta'  , 'Pink'   , 'Lila'      , 'Rot'    , 'Silber'     , 'Weiss', 'Gelb'   ),
'ru':	( 'Черный' , 'Синий', 'Коричневый', 'Золотой', 'Серый', 'Зеленый', 'Пурпурный', 'Розовый', 'Фиолетовый', 'Красный', 'Серебристый', 'Белый', 'Желтый' )