Subject Re: CAST doesn't work in SELECT
Author Adam
--- In firebird-support@yahoogroups.com, "Fabio Gomes" <fabioxgn@...>
wrote:
>
> The field is Varchar(30) because other configs uses strings,
numbers and
> other stuff.. and some just uses "Y" and "N", i made the table this
way
> cause i thought it would be the best way to store all configs in
the same
> place, if i were to make one table for each kind of config, bool,
string,
> numeric, etc, i think it would be more messed up than having
everything in
> just one table.. or would more tables be better than just one?
assuming that
> i will have something like 200+ rows in this config table.

All I am warning is that it is possible for someone to store 'YES' in
the field, through an admin tool or possibly one day through a bug in
your program, and while the cast as varchar(1) would work providing
no field contained such an illegal value, a safer approach may be to
use a substring function.

We do something similar so I understand your problem.

Adam