Project

General

Profile

How to use platform independent unsigned data types in dbo??

Added by Rathnadhar K V almost 10 years ago

Namasthe,

When I use

uint32_t

which is 32 bits, platform independent unsigned int, I get compile time error.

However if change the same to just int then there is no compile time error.

{code :

in header file:

dbo::field(action, membership_number, "membership_number");

in src file:

dbo_session.mapClass("club_member_info");

}

how can i use uint32_t instead of int?

regards

Rathnadhar K V


Replies (2)

RE: How to use platform independent unsigned data types in dbo?? - Added by Koen Deforche almost 10 years ago

Hey,

SQL does not have support for unsigned types. Wt::Dbo therefore only provides the mapping of types that have a SQL counter part.

You should decide for yourself how you want the unsigned to be stored in your database. And based on that put the correct type in your Wt::Dbo class, and then do the conversion from and to unsigned in your class interface.

Koen

RE: How to use platform independent unsigned data types in dbo?? - Added by Rathnadhar K V almost 10 years ago

Thanks for the reply. I changed to signed format.

    (1-2/2)