Handling Boolean datatypes in Sqlite

Put your problem here if it does not fit any of the other categories.

Handling Boolean datatypes in Sqlite

Postby Katharnavas » Wed Jan 09, 2008 11:59 am

Hi,
I have created a database and and a table in sqlite which consists of datatypes(varchar, Integer and Boolean).I have inserted the data in to the table of the specified datatype. While retrieving data im quite surprised seeing that cursor.getString(columnindex) and cursor.getInt(columnindex) methods are available .. what about the boolean type i couldnt find any methods for resolving the boolean type..
Am i missing something ? any suggestions will be helpful to resolve the problem.
Katharnavas
Senior Developer
Senior Developer
 
Posts: 100
Joined: Tue Dec 04, 2007 5:57 am
Location: India

Top

Postby plusminus » Wed Jan 09, 2008 5:52 pm

Hello

SQLite doesn't have a dedicated boolean type. You just store them in "C"-Style as Integer, '== 0' for false and '!= 0' for true.

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby Katharnavas » Thu Jan 10, 2008 4:57 am

plusminus wrote:Hello

SQLite doesn't have a dedicated boolean type. You just store them in "C"-Style as Integer, '== 0' for false and '!= 0' for true.

Regards,
plusminus


Thats the way remains what i thought was when it can accept boolean datatype then there should be someway to retrieve it also.. Then i should have to go with the c style only.
Katharnavas
Senior Developer
Senior Developer
 
Posts: 100
Joined: Tue Dec 04, 2007 5:57 am
Location: India

Postby plusminus » Thu Jan 10, 2008 1:07 pm

Hello Katharnavas,

yes that would be fine, just a kind of standard-wrapper within the sdk :( .

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot] and 43 guests