Topic: Text field in SQLite

SQLitePass 0.5
Delphi 2010

Trying to use a text field.
- Created database with text field
- using SQLitePassDataset
- This text field is visible in the fields editer as a TWideStringField but the Size has a limit of 30 chars

Why 30 chars, it's a text field. I can't change it, this fields is fixed on 30.

Regards,
Pascal

Re: Text field in SQLite

Just did a test with Zeos.

It works with Zeos, the text field is a TMemoField now with no Limit

Regards,
Pascal

Re: Text field in SQLite

Hi Pascal,

The component always converts text fields to TWideStringField with d2009 and 2010.

The 30 chars default size is automatically set when no field size can be retrieved from the table create statement.

You should be able to change the default field type using the database.datatypeOptions.CustomFieldDefs but I didn't test it thoroughly yet...

Send your db by mail if you need to.

Regards.
Luc

Re: Text field in SQLite

9  down vote accepted
   

If you want to store a pickled object, you'll need to use a blob, since it is binary data. However, you can, say, base64 encode the pickled object to get a string that can be stored in a text field.

Generally, though, doing this sort of thing is indicative of bad design, since you're storing opaque data you lose the ability to use SQL to do any useful manipulation on that data. Although without knowing what you're actually doing, I can't really make a moral call on it.

Re: Text field in SQLite

Just now i did a test it worked!
Thanks buddy!


------------------------------------------------------------------------------

Last edited by shirishsmb (2010-11-03 17:53:46)