I need to store large strings in a sqlite database. (10K strings). Should I make it a blob? I made them varchar, and I'm able to store them, but when I do a query to get the string , it works, but when I free the query object, I get an access violation. If I don't reference that field by name, it doesn't blow up. I think just by referencing it, it somehow get's held by something.

I need to store large strings in a sqlite database. (10K strings). Should I make it a blob? I made them varchar, and I'm able to store them, but when I do a query to get the string , it works, but when I free the query object, I get an access violation. If I don't reference that field by name, it doesn't blow up. I think just by referencing it, it somehow get's held by something.

I have two other fields that ARE blobs, and those work ok.

Comments

  1. AFAIK sqlite types are just hints, you can store anything in any field :)

    ReplyDelete
  2. The issue is for sure in the component you are using to access SQLite. SQLite doesn't bother what the field type is.
    Probably that component can't handle well long strings if they are declared as varchar.

    ReplyDelete
  3. Turns out if I treat the field like a blob, and create a blob stream and load it into a string stream, it works. I'm able to close the query object (I think that's what freeing it does first before freeing). I had noticed that I got the access violation by just closing the query.

    ReplyDelete

Post a Comment