Rajan, Vivek K said:
> I would like to know the following:
>
> *        Does SQLite support enum like MySQL? If yes, how to use it
>
> *        If not, is there another way to model enumeration in SQLite?
> And/or any plans going forward to support enums natively in SQLite?

SQLite doesn't support enums natively.  You could emulate it using
triggers, although it would be somewhat hidden and definitely a pain in
the tucus to use.

If your database is only going to be accessed by applications that you
control, it's really easy to emulate enumerations in your own code, by
restricting the possible values that can be used for a field in code.  In
the languages that I'm familiar with (C, C++, Delphi, PHP) this is best
accomplished by making a data access class for each table and putting the
logic in that class.  In fact my preference is to encode the value as a
language enum where that's possible (I'm not sure if PHP handles enums).

Clay Dowling
-- 
Simple Content Management
http://www.ceamus.com

Reply via email to