Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Datenbanken (https://www.delphipraxis.net/15-datenbanken/)
-   -   Prism D2006 + Interbase 7.5 / Decimal(5,2) / Absurde Werte (https://www.delphipraxis.net/61272-d2006-interbase-7-5-decimal-5-2-absurde-werte.html)

gluglu 19. Jan 2006 09:47

Datenbank: InterBase • Version: 7.5 • Zugriff über: TIBQuery

D2006 + Interbase 7.5 / Decimal(5,2) / Absurde Werte
 
Hallo !!

Für bestimmte Felder die Prozente beinhalten habe ich diese als DECIMAL(5,2) definiert. (z.B. 20,50%) (min 0,00 max 100,00).

Delphi 2006 kann mit diesen Feldern anscheinend nicht richtig umgehen, denn bei jeden TDBEdit oder TDBGrid bekomme ich absurde Werte. Falls ich meine Felder umdefiniere als DECIMAL(10,2) funktioniert es richtig.

In der IB-Dokumentation steht folgendes:
Zitat:

How fixed-decimal datatypes are stored
When you create a domain or column with a NUMERIC or DECIMAL datatype, InterBase determines which datatype to use for internal storage based on the precision and scale that you specify and the dialect of the database.
• NUMERIC and DECIMAL datatypes that are declared without either precision or scale are stored as INTEGER.
• Defined with precision, with or without scale, they are stored as SMALLINT, INTEGER, DOUBLE PRECISION or 64-bit integer. Storage type depends on both the precision and the dialect of the database. Table 4.2 describes these relationships.

Table 4.2 NUMERIC and DECIMAL datatype storage: dialects 1 and 3

Precision Dialect 1 Dialect 3
1 to 4 • SMALLINT for NUMERIC SMALLINT
datatypes
• INTEGER for DECIMAL
datatypes
5 to 9 INTEGER INTEGER
10 to 18 DOUBLE PRECISION INT64

Aber warum sollte DECIMAL(5,2) nicht richtig behendelt werden von D2006 ?

Irgend jemand hat dafür eine Erklärung ?

Danke und Grüsse !

Gollum 19. Jan 2006 10:14

Re: D2006 + Interbase 7.5 / Decimal(5,2) / Absurde Werte
 
Hallo,

hilft es, den Datentyp als DECIMAL(6,2) zu definieren?

Weil: 3 Vorkommastellen, 2 Nachkommastellen plus Komma macht insgesamt 6 Stellen!


Alle Zeitangaben in WEZ +1. Es ist jetzt 23:56 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz