bildwelt
E2E FORUM
E2E Bridge E2E Commerce

SQLite handling of BOOL

E2E Forum Modeling & Development SQLite handling of BOOL

This topic contains 2 replies, has 2 voices, and was last updated by  Cliff Faurer 2 years, 9 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1821

    Cliff Faurer
    Participant

    Hello,

    I’m using an SQLite DB that has a BOOL column. Inserting into the DB works fine and true is recorded as 1 and false as 0 in the BOOL field. But on the query I get the following error: Can not convert output type (7) of database column ‘isLegalEntity’ to internal type ‘Boolean’

    The class I’m returning the query results to has an attribute isLegalEntity of type Boolean [Base Types].

    Please advise.

    Thanks,
    Cliff

    #1824

    Alfred
    Moderator

    This answer applies only to SQLite.

    If you want to have Boolean in the model you need to use TEXT (or other type which maps to TEXT storage class http://www.sqlite.org/datatype3.html) in the database. True maps to “1” and false to “0” in the database.

    If you want to use BOOL in the SQLite database you have to use Integer
    in the model.

    #1828

    Cliff Faurer
    Participant

    Hello Alfred,

    Thanks for the answer. I’m using the Firefox SQLite Manager and it has a BOOL type, which is what threw me off.

    Thanks,
    Cliff

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.