Subject | Re: [firebird-support] cast 'nnn,nn' to float |
---|---|
Author | Michael Ludwig |
Post date | 2008-11-28T00:46:07Z |
danyschaer schrieb am 27.11.2008 um 19:54:09 (-0000):
dots.
Firebird 1.5 comes with only a minimal set of SQL functions, and it
doesn't look like that has changed in 2.0. Nothing in there to do string
replacement. Don't know about 2.1, nor which version you're using.
You may find an external function (UDF) somewhere that does the
necessary string replacement for you.
the proper versions of your "floating values", and then do the
conversion in a one-off script using the API of your choice. Something
like Perl or Java or whatever should give you full control over the
up-conversion process.
And then I'd drop that floating VARCHAR, provided it isn't needed any
more.
Michael Ludwig
>I don't think so. You'll have to convert them, replacing commas with
> I am working with a table that have into varchar fields some floating
> values, but they use a comma as decimal separator (regarding regional
> settings).
>
> Is it possible to cast this values to floating point values??
dots.
Firebird 1.5 comes with only a minimal set of SQL functions, and it
doesn't look like that has changed in 2.0. Nothing in there to do string
replacement. Don't know about 2.1, nor which version you're using.
You may find an external function (UDF) somewhere that does the
necessary string replacement for you.
> ... so I can run filters like:I'd consider adding a DECIMAL or FLOAT column to your table to receive
>
> select fff from ttt where cast(fff as float) > 100
the proper versions of your "floating values", and then do the
conversion in a one-off script using the API of your choice. Something
like Perl or Java or whatever should give you full control over the
up-conversion process.
And then I'd drop that floating VARCHAR, provided it isn't needed any
more.
Michael Ludwig