On Fri, May 6, 2011 at 2:16 AM, Simon Slavin <slav...@bigfraud.org> wrote:

> SQLite allows any column to contain values of any type.  If
> SQLiteDataReader.VerifyType is to respect that then I don't think it has any
> use at all.  On the other hand, if you choose to use it with your database,
> then presumably you should be careful not to put anything but binary data in
> a BLOB column
>

In the interest of cross-db portability, i've sometimes found that it's
convenience check a column's type for both string or blob. e.g. MySQL
 reports TEXT fields as a BLOB but sqlite3 happily handles them as strings.
Likewise when binding values - try to bind as a blob, and if that fails try
as a string. If THAT fails, then fail the operation. Of course when working
with non-xpm graphical data (or similar), binding as a string will have
undefined results (in my case i'm just dealing with JSON data, so the
encoding is predefined).

-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to