Page 1 of 1

UniLoader with firebird numeric(14,2)

Posted: Tue 07 May 2013 01:02
by tonymeadors
Many of our Firebird fields are numeric(14,2).

While the UniLoader works well with all other fields (string, date, int, etc)
trying to insert records containing these wider numerics gives me the error:
CANNOT CONVERT TYPE.

Simple example:
// connected to a firebird DB
// ID is integer
// com_set_amount is numeric(14,2) [yielding ftfmtBcd as tfield datatype]
// structure of cd_med is identical to cd_dental
mUniloader.TableName:='cd_dental';
q.sql.Add('select id, com_set_amount from cd_med');
q.open;
mUniloader.createcolumns;
mUniloader.loadfromdataset(q);

I have tried all kinds of things but the error is consistent:
"Cannot Convert Type"
If the numeric field is removed from the select everything is fine.

Thanks for the help and great forum,

tony M

Re: UniLoader with firebird numeric(14,2)

Posted: Mon 13 May 2013 13:04
by AndreyZ
I cannot reproduce this problem. Please try using the latest UniDAC version 5.0.1 and check if the problem persists. If it does, please specify the following:
- the script to create the cd_med and cd_dental tables;
- the exact version of your IDE;
- the exact version of Firebird server and client. You can learn it from the Info sheet of TUniConnection Editor.

Re: UniLoader with firebird numeric(14,2)

Posted: Tue 14 May 2013 18:07
by tonymeadors
Thank you for taking a look.
We are using UniDac 4.02 for this round of building
and prepping code for clients.

NOTE: in testing, the error only appears if the field actually
contains numeric data...if the column is empty no convert error
occurs. Not surprising.

Our further testing found that datsets containing a
field of datatype ftFMTBCD consistently gives this error when
we call the uniloader loadfromdataset function.

Firebird fieldsize Datatype in query dataset Uniloader
numeric(8,2) ftBCD Transfers
numeric(9,2) ftBCD Transfers
numeric(10,2) ftFMTBCD Cannot convert error

Hope this helps isolation and your determination whether
5.x is immune to this problem.

Sincerely,
tonyM
ClearCycle

Re: UniLoader with firebird numeric(14,2)

Posted: Mon 20 May 2013 05:26
by AndreyZ
I cannot reproduce this problem neither with UniDAC 4.0.2 nor with UniDAC 5.0.1. Please specify all the information I asked you in my previous email.