Subject | Re: [firebird-support] How to scale in the IB API? |
---|---|
Author | Richard Wesley |
Post date | 2007-04-06T22:37:23Z |
On Apr 5, 2007, at 20:21, Helen Borrie wrote:
can't fix their schema. But I seem to have figured out how to deal
with it...
relevant for integer return types. Floating point ones have already
been scaled. I was assuming that they had not e.g.
if ( x.sqlscale ) {
if ( int type ) scale integer
else if (float type )scale float
}
Removing the float type case fixed the problem.
________________________________________________________
Richard Wesley Senior Software Developer Tableau
Software
Visit: http://www.trytableau.com/now.html
> Hmmm, something is amiss there that you don't knowSadly, the tester cannot share their data - and even if they could, I
> about. RDB$FIELD_PRECISION should never be negative for a fixed
> numeric type. A decimal(15,4) in dialect 3 would have precision of
> 18; in D1 it would be a DOUBLE PRECISION, since D1 doesn't support
> fixed numerics with > 9 digits of precision. Ask for a metadata-only
> backup and see what's really going on (including the
> dialect). However, restoring the metadata-only backup won't give the
> answer if it's an ODS9 database that has been restored to ODS 10 or
> higher...you'd need the data, since it's likely that the restore has
> simply written the precision for those doubles as -1, due to their
> being neither one thing nor the other under the higher ODS.
can't fix their schema. But I seem to have figured out how to deal
with it...
> Note, too, that the XSQLVAR.sqlscale member returns RDB$FIELD_SCALE,Yes, and it turns out that even if sqlscale is set, it is only
> not RDB$FIELD_PRECISION...
relevant for integer return types. Floating point ones have already
been scaled. I was assuming that they had not e.g.
if ( x.sqlscale ) {
if ( int type ) scale integer
else if (float type )scale float
}
Removing the float type case fixed the problem.
________________________________________________________
Richard Wesley Senior Software Developer Tableau
Software
Visit: http://www.trytableau.com/now.html