T
Tom said:Whoops, you're quite right, it should.
Actually, the way I see it is the public integer is an *external* key.Lew said:But it's a type-safe int!
Martin said:Agreed - and hold the integer:name mapping as a separate table.david.karr wrote:
Quite often databases will have columns that are stored as integers,
but represent enumerated values. In object-relational mapping, it's a
good idea to translate that integer value to the enumerated value it
represents.
[ SNIP ]
It's an even better idea to store the enumeration "name" as a varchar.
Or don't even bother with integers in the database at all, but just use
the VARCHAR value.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.