Lothar Scholz
<scholz-qqUfbLNYxjJCkLs28/[EMAIL PROTECTED]> wrote:
Friday, January 18, 2008, 8:09:02 PM, you wrote:
Lothar Scholz
<scholz-qqUfbLNYxjJCkLs28/[EMAIL PROTECTED]>
wrote:
it seems that "Lothar" is stored as a TEXT value but when i store
X'4C6F74686172' it is a BLOB.
What is the reason for it?
Same reason 1 is an integer literal but '1' is a string literal.
X'4C6F74686172' is a blob literal.
Sorry as far as i understand the dynamics of datatypes they should
depend on the bytes that are passed but not on the literal that
is used for notation inside a textual SQL statement.
You misunderstand the dynamics of datatypes then.
How do you plan to determine, just looking at a sequence of bytes,
whether it looks like a string or not? Especially given your claim below
that you want to support control characters in a string. In your
hypothetical implementation, how would I construct a BLOB literal that
would _not_ be interpreted as a string, but inserted as a BLOB as I
intended?
Another question, how would you realiable represent contrl characters
in the range 1-31 in a string? It is not really good to add them as
plain code in text files and SQLite does not have C like backslash
quoting. Especially the automatic %R%N->%N conversions might be a
huge
problem. And i don't think we should restrict the TEXT data type to
anything more then non zero bytes.
What do you mean, data content? How is it supposed to know that a
particular sequence of bytes is supposed to represent a string,
without
the help of mind-reading hardware? After all, you don't expect the
number 48 to be magically interpreted as a string '0'. You don't,
right?
Well if it looks like a number it is a number. If it does not look
like a number it is either a TEXT or if it contains zero (or maybe
non text
control characters others then usually defined \f \v \r \n) it is a
BLOB. This would make sense for me.
Wait a minute. Didn't you just say that you _want_ text strings to be
able to contain control characters? So what's left for the BLOB then?
Suppose I want to insert, say, a bitmap image into the database - as a
BLOB, naturally. You are saying that, if it doesn't just happen to
contain at least one zero byte, it will have to go in as a string. So if
it has a black pixel, it's a BLOB. If it doesn't have any black pixels,
it's a string. Does this really make sense to you?
Igor Tandetnik
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------