Subject [IBO] Re: Size mismatch for field...
Author fabiano_bonin
> I don't know what your story is. It's a long time since I used
BCD fields
> but, AFAIR, you always had this error if the scale of the stored
numeric or
> decimal was smaller than the BCD precision setting.

I think my story isn't different from others. I just use 'add all
fields' within TIBOQuery and it adds the BCD fields. I don't know a
way (or why) of don't use BCD fields.

Ok, i did a simple test case that maybe help somebody to identify
what is causing the problem.

First of all, i created this table:

create table bcd_test (
field1 numeric(5,2) );

Then, i created a new project in Delphi, added a TIBODatabase and a
TIBOQuery in the form.
After setup the TIBODatabase, i changed the SQL property of the
TIBOQuery to 'select * from bcd_test'.
So i double-clicked the TIBOQuery, right-clicked the fields editor
and selected 'Add all fields'.

I did the same step above with both 4.2Gc and 4.3Aa.

Below are 3 DFM's:
A) generated with IBO 4.2Gc
B) generated with IBO 4.3Ga
C) same as A), but after the project was opened with IBO 4.3Ga
(nothing changed)

As you can note, the field generated with IBO 4.2Gc is a
TIBOBCDField, while the field generated with IBO 4.3Ga is a
TBCDField. Is it a known behavior change?

A) generated with IBO 4.2Gc

object Form1: TForm1
Left = 192
Top = 114
Width = 696
Height = 480
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object IBODatabase1: TIBODatabase
SQLDialect = 3
Params.Strings = (
'PATH=teste'
'USER NAME=SYSDBA'
'SQL DIALECT=3'
'SERVER=interbase.leonilda.com.br'
'PROTOCOL=TCP/IP')
Left = 8
Top = 8
end
object IBOQuery1: TIBOQuery
Params = <>
DatabaseName = 'interbase.leonilda.com.br:teste'
IB_Connection = IBODatabase1
RecordCountAccurate = True
SQL.Strings = (
'select * from bcd_test')
FieldOptions = []
Left = 40
Top = 8
object IBOQuery1FIELD1: TIBOBCDField
FieldName = 'FIELD1'
end
end
end


B) generated with IBO 4.3Ga

object Form1: TForm1
Left = 192
Top = 114
Width = 696
Height = 480
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object IBODatabase1: TIBODatabase
SQLDialect = 3
Params.Strings = (
'SERVER=interbase.leonilda.com.br'
'PATH=teste'
'PROTOCOL=TCP/IP'
'USER NAME=SYSDBA'
'SQL DIALECT=3')
Left = 8
Top = 8
end
object IBOQuery1: TIBOQuery
Params = <>
DatabaseName = 'interbase.leonilda.com.br:teste'
IB_Connection = IBODatabase1
RecordCountAccurate = True
SQL.Strings = (
'select * from bcd_test')
FieldOptions = []
Left = 40
Top = 8
object IBOQuery1FIELD1: TBCDField
FieldName = 'FIELD1'
Precision = 9
Size = 2
end
end
end


C) same as A), but after the project was opened with IBO 4.3Ga
(nothing changed)

object Form1: TForm1
Left = 192
Top = 114
Width = 696
Height = 480
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object IBODatabase1: TIBODatabase
SQLDialect = 3
Params.Strings = (
'PATH=teste'
'USER NAME=SYSDBA'
'SQL DIALECT=3'
'SERVER=interbase.leonilda.com.br'
'PROTOCOL=TCP/IP')
Left = 8
Top = 8
end
object IBOQuery1: TIBOQuery
Params = <>
DatabaseName = 'interbase.leonilda.com.br:teste'
IB_Connection = IBODatabase1
RecordCountAccurate = True
SQL.Strings = (
'select * from bcd_test')
FieldOptions = []
Left = 40
Top = 8
object IBOQuery1FIELD1: TIBOBCDField
FieldName = 'FIELD1'
end
end
end