How to convert BIGINT to INTEGER ?

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
swierzbicki
Posts: 451
Joined: Wed 19 Jan 2005 09:59

How to convert BIGINT to INTEGER ?

Post by swierzbicki » Fri 01 Feb 2008 08:48

Hi,

I'm some problems (I guess it is MySQL related) :
Case
When Table1.Field1 is null the Table2.Field1 else Table1.Field1
End As Field1
Table2 is an alias of Table1 (left outer join table1 as tables2....)
field1 is an Integer

The case statement is returning a LargeInteger.

Is it possible to convert this LargeInteger into an integer (so that delphi will not raised an exception when the data type will not match the one stored in the persistent field)

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Wed 06 Feb 2008 15:21

MySQL server returns for this query a field of the LargeInt type.
Now MyDAC does not provide means to convert LargeInt fileds to Integer fields, but we will support such functionality in the next MyDAC build.

swierzbicki
Posts: 451
Joined: Wed 19 Jan 2005 09:59

Post by swierzbicki » Thu 07 Feb 2008 09:33

Hi Dimon,

Thank you for the answer.

Post Reply