Subject | Re: [firebird-support] Re: CAST doesn't work in SELECT |
---|---|
Author | Fabio Gomes |
Post date | 2006-08-04T01:34:16Z |
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.
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.
On 8/3/06, Adam <s3057043@...> wrote:
>
> > Sorry for hijacking the topic but, i need to select a varchar(30) as
> > char(1), should i use cast?
> >
> > The reason is that i have a config table that have 2 fields (config and
> > value) and some configs will be always "Y" or "N", so can i use cast
> in this
> > case?
>
> Why would it always be 'Y' or 'N' and be defined as varchar(30)? Cast
> as varchar(1) will raise an exception if more than 1 character is found.
>
> I would use the substr UDF call in ib_udf.dll, or I think a substring
> command is introduced in the engine in FB 2.
>
> Adam
>
>
>
[Non-text portions of this message have been removed]