Hi,

I think the precision should be 3 for this case. That means it's a bug in
H2. Running this in the H2 Console:

@meta SELECT 0.02 ;
@meta SELECT 1.02 ;

Results:
Precision 1, scale 2; precision 3, scale 2 (H2)
Precision 0, scale 0; precision 0, scale 0 (PostgreSQL)
Precision 3, scale 2; precision 3, scale 2 (MySQL)
Precision 2, scale 2; precision 3, scale 2 (Apache Derby and HSQLDB)

That means only MySQL reports 3/2, all other databases report something
else.

So, I don't think you should rely on the database metadata in this case, if
you care about compatibility with other databases.

Regards,
Thomas


On Wed, May 21, 2014 at 11:45 AM, <[email protected]> wrote:

> Well, but why doesn't allow H2 the following then:
>
> *create table *x *(*x DECIMAL*(**1*,*2**))*
>
>
> Kind regards
>
> Christoff Schmitz
>
> F I N A R I S
> Financial Software Partner GmbH
> Sömmerringstrasse 23
> 60322 Frankfurt am Main
>
> Fon:      +49 (0)69  / 254 98 - 24
> Mobile: +49 (0)176 / 206 34 186
> Fax:       +49 (0)69  / 254 98 - 50
> eMail:    mailto:[email protected]
> <[email protected]>
> www:      http://www.finaris.de und http://www.rapidrep.com
>
>
>
> From:        Noel Grandin <[email protected]>
> To:        [email protected]
> Date:        21.05.2014 11:34
> Subject:        Re: [h2] Error in Meta data of ResultSet
> Sent by:        [email protected]
> ------------------------------
>
>
>
>
>
> On 2014-05-21 10:37, [email protected] wrote:
> >
> > *SELECT**0.02*
> >
> > tells that the precision of the numeric column is 1 (but obviously it
> should be >= 2 (scale)).
> >
>
> No, the precision is the number of significant digits in a number.
> In this case the precision is 1 since there is only one significant digit
> in the number.
>
> --
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/h2-database.
> For more options, visit https://groups.google.com/d/optout.
>
>
>
>
> ================================================================================================================
> Disclaimer
> The information contained in this e - mail and any attachments ( together
> the "message") is intended for the addressee only and
> may contain confidential and/or privileged information. If you have
> received the message by mistake please delete it and notify
> the sender and do not copy or distribute it or disclose its contents to
> anyone.
>
> FINARIS Financial Software Partner GmbH, Sömmerringstr. 23, 60322
> Frankfurt/Main, Germany
> Registered at Frankfurt/Main, HRB 52873, Managing Directors: Dipl. Inf.
> Hermann Friebel, Dipl. Ing. Kai Bächle, Dipl. Inf. Werner Märkl
>
> ================================================================================================================
>
> --
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/h2-database.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to