Subject Re: Converting from blob to another type
Author Adam
--- In firebird-support@yahoogroups.com, Jiri Cincura <diskuze@...> wrote:
>
> On 30.5.2006 12:51 +0200 Martijn Tonies wrote:
> >> I've some (for now float/int) values saved in blob column. Is
there any
> >> option how to convert blob to int/float or else type? The cast
statement
> >> isn't working. :(
> >>
> >> PS: Saving this into blob column, because I need to have in this
column
> >> strings and "integers" together. :(

Pretty much violates the relational model when data can not be typed.
Perhaps it is mostly numeric with a few other alpha characters? If so,
it should be a domain based on (var)char with constraint rules as
appropriate.

> >
> > Why not use (VAR)CHAR? Or are the values very long?
> >
>
> For this time no. But I'm not sure what will be in future. But if
there's no
> other way, I'll convert it to varchar.

The most negative integer you can possibly store is '-2147483648',
that will fit in a varchar(11). If by integer you mean 64 bit BIGINT,
the number is '-9223372036854775808' and that will fit in a varchar(20).

This hardly pushes the bounds of reasonable storage.

Adam