Oops - the second paragraph should have read:
"with appropriate manipulations of sqlite3_value_type(),
sqlite3_value_bytes() and sqlite3_value_text()."
--- Joe Wilson <[EMAIL PROTECTED]> wrote:
> Length() is perfectly consistant with the value's type. As you've
> demonstrated, Sqlite does not respect the column types in tables
> as declared in the CREATE statement.
> Length(text_value) always returns the number of characters and
> length(blob_value) always returns the number of bytes. The type
> of the value depends solely on its type at the time of INSERT
> or UPDATE. I believe the Sqlite author calls this feature
> "manifest typing".
>
> When coding in C you can easily get the number of bytes in a TEXT
> or BLOB value with appropriate manipulations of sqlite3_value_type(),
> sqlite3_result_int() and sqlite3_result_text(). So no problem there.
>
> I do not think that Sqlite SQL writers (i.e., non-C progammers) care
> to know the number of bytes their objects take as long as their
> assignments and comparison operations work within the framework of
> the SQL language. 'Bytes' is more of a low-level C concept. But if
> for some reason you absolutely must need to know the number of bytes
> that a text or blob value takes from within the Sqlite SQL language,
> just refer to the documentation of typeof(), CAST, CASE and quote()
> and you can come up with a pure Sqlite SQL solution if you really
> wanted to.
>
__________________________________
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com