Dealing with BigInt and Int64 in DB2 UDB for z/OS

Posts   
 
    
Devildog74
User
Posts: 719
Joined: 04-Feb-2004
# Posted on: 08-Feb-2007 10:55:01   

Apparently UDB for Z/OS doesnt support the BigInt data type. My llblgen code is using Int64. I changed the data type in the table to double. When the data is read out of the database as double it doesnt cast to Int64. So the code in my entity class is failing.

I dont want to re-generate the code.

Does anyone know of a DB2 UDB z/OS data type that I can use so that the data will cast from object into Int64?

This line is failing in my generated entity:


return (System.Int64)valueToReturn;

valueToReturn is an object.

I am also assuming that this code: object valueToReturn = base.GetCurrentFieldValue .... is returning an double.

I could replace


return (System.Int64)valueToReturn;

with this:


return Convert.ToInt64(valueToReturn);

but I would like to avoid changing the code.

Please help.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39906
Joined: 17-Aug-2003
# Posted on: 08-Feb-2007 12:08:22   

You could use a typeconverter which converts from double to int64 and back. This will affect db specific code only, so your db generic code will be able to keep in tact as well as your own code.

Frans Bouma | Lead developer LLBLGen Pro
Devildog74
User
Posts: 719
Joined: 04-Feb-2004
# Posted on: 08-Feb-2007 17:04:58   

I have considered this, was hoping this would be a last resort as I "really" dont want to regenerate.

Is there no datatype that you know of that will cast?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39906
Joined: 17-Aug-2003
# Posted on: 08-Feb-2007 18:05:49   

Not that I know of. The only type mapped to int64 is Bigint.

Frans Bouma | Lead developer LLBLGen Pro