Page 1 of 1

ParamByName ('XXX').AsLargeInt

Posted: Wed 20 Oct 2010 03:37
by yartoo
We are having trouble with the .AsLargeInt method of the TParams class.
We have large integer values in the database and want to assign the values as large integers; e.g.

TheQuery.SQL.Add ('Select *');
TheQuery.SQL.Add ('from Prodn_unit');
TheQuery.SQL.Add ('where Unit_id = :UnitId');
TheQuery.ParamByName ('UnitId').AsLargeInt = fUnitId;

where fUnitId is declared as an Int64;

When we do this we get the following error...

"Error converting data type varchar to bigint."

We currently work around this by checking all parameters in all queries and changing the data type from ftLargeInt to ftString when the database is Ms SQL Server. (We are supporting multiple database systems in our application). AsLargeInt works for other databases in DbExpress.

Is this a problem in the Devart DbExpress driver or Ms SQL Server?

Shaun

Posted: Wed 20 Oct 2010 14:19
by AndreyZ
Hello,

Please specify what SQL Server type you are using for the Unit_id field. For storing Int64 data types in SQL Server you have to use bigint type.

Posted: Wed 20 Oct 2010 16:06
by yartoo
AndreyZ,

Ms SQL Server 2005
Unit_id is a bigint

Shaun

Posted: Thu 21 Oct 2010 07:27
by AndreyZ
Please specify the following information:
- the exact version of DbxSda;
- the exact version of your IDE.

Posted: Thu 21 Oct 2010 23:20
by yartoo
AndreyZ,

DbxSda:
File and Product version: 4.75.0.26

Delphi RAD Studio:
Embarcadero® Delphi® 2010 Version 14.0.3593.25826

Thanks
Shaun

Posted: Tue 26 Oct 2010 09:04
by Dimon
Thank you for the information. We have reproduced this problem and fixed it. This fix will be included in the next DbxSda build.

Posted: Tue 26 Oct 2010 12:22
by yartoo
Thanks Dimon.

As soon as we get it, I'll rip out all that ugly parameter searching code.

Shaun