Einzelnen Beitrag anzeigen

gluglu

Registriert seit: 10. Dez 2005
32 Beiträge
 
#1

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

  Alt 19. Jan 2006, 09:47
Datenbank: InterBase • Version: 7.5 • Zugriff über: TIBQuery
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 !
  Mit Zitat antworten Zitat