Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-05

Trouble with TIBConnection and Numeric (N,6) fields.

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Gerard N/A

Hi all,

I've got a problem acessing a Firebird DB (2.0) with TIBConnection + TSQLQuery. I get 'Unkonwn field type <FieldName>' when opening querys wich do selects to tables having NUMERIC fields with 6 decimals.

Any idea on how to fix this?

Regards,

Gerard.

Reply by email

Joost van der Sluis
to Gerard N/A

Op vrijdag 23-05-2008 om 11:17 uur [tijdzone +0200], schreef Gerard N/A:

Show quoted text 7 lines
Hi all, I've got a problem acessing a Firebird DB (2.0) with TIBConnection + TSQLQuery. I get 'Unkonwn field type <FieldName>' when opening querys wich do selects to tables having NUMERIC fields with 6 decimals. Any idea on how to fix this?

Yes, implement TFmtBCDField. At this moment, fpc doesn't support decimal fields with more then 4 decimals.

Joost.

Reply by email

Gerard N/A
to Joost van der Sluis

Ok, thanks.
I've been looking into LCL code, but I guess this is belongs to FPC's source?

Gerard.

Joost van der Sluis wrote 19 lines
Op vrijdag 23-05-2008 om 11:17 uur [tijdzone +0200], schreef Gerard N/A: > Hi all, > > I've got a problem acessing a Firebird DB (2.0) with TIBConnection + TSQLQuery. > I get 'Unkonwn field type <FieldName>' when opening querys wich do > selects to tables having NUMERIC fields with 6 decimals. > > Any idea on how to fix this? Yes, implement TFmtBCDField. At this moment, fpc doesn't support decimal fields with more then 4 decimals. Joost. _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Joost van der Sluis
to Gerard N/A

Yes. It's in packages/fcl-db/src/base/fields.inc and db.pp. You can take the 'TBCDField' as an example (ie: copy-paste it). Main difference is that the data of the field shoudn't get stored in an TCurrency, but in a TFmtBCD. You have to add the unit which implements TFmtBCD for this to the uses-clause of the db-unit. (This unit is new, that's why it wasn't implemented before)

If you did this, you should add the TFmtDCBField support in packages/fcl-db/src/sqldb/interbase/ibconnection.pp. Just take the TBCDField-code as an example again.

If you have any questions, you can ask them here. Good luck!

Joost.

Op maandag 26-05-2008 om 09:12 uur [tijdzone +0200], schreef Gerard N/A:

Show quoted text 30 lines
Ok, thanks. I've been looking into LCL code, but I guess this is belongs to FPC's source? Gerard. On Sun, May 25, 2008 at 3:06 PM, Joost van der Sluis wrote: > Op vrijdag 23-05-2008 om 11:17 uur [tijdzone +0200], schreef Gerard N/A: >> Hi all, >> >> I've got a problem acessing a Firebird DB (2.0) with TIBConnection + TSQLQuery. >> I get 'Unkonwn field type <FieldName>' when opening querys wich do >> selects to tables having NUMERIC fields with 6 decimals. >> >> Any idea on how to fix this? > > Yes, implement TFmtBCDField. At this moment, fpc doesn't support decimal > fields with more then 4 decimals. > > Joost. > > _______________________________________________ > Lazarus mailing list > > http://www.lazarus.freepascal.org/mailman/listinfo/lazarus > _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email