Oh, thanks! I guess I must have misinterpreted the bit in the docs about
column_type. I used to get column types prior to reading values from all the
rows, but I guess I have to get the column type for every value that I read
from the row? Not hard to change, just want to make sure I understand it
correctly.

Thanks!

-Boris

-- 
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5

[EMAIL PROTECTED]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Saturday, March 18, 2006 5:03 AM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] varchar(20) column reported as SQLITE_NULL?

"Boris Popov" <[EMAIL PROTECTED]> wrote:
> While executing 'SELECT REGION FROM EMPLOYEE' I came across a column that
is
> SQLITE_NULL as far as sqlite3_column_type is concerned, but really is
> varchar(20) if you ask for sqlite3_column_decltype? Is varchar(20) illegal
> in SQLite? Certainly looks like "typename ( number )" is okay at
> http://www.sqlite.org/lang_createtable.html
> 

sqlite3_column_type returns the datatype of the information
stored in a particular row of the column - not the declared
type of the column itself.  If you store a NULL in that row,
then sqlite_colulmn_type will return SQLITE_NULL.  If you 
store a blob, it will return SQLITE_BLOB.  If you store text
it will return SQLITE_TEXT.  If you store a numeric value,
the numeric will be converted to text automatically so there
is no way to get an SQLITE_INTEGER or SQLITE_FLOAT from a
varchar() column.
--
D. Richard Hipp   <[EMAIL PROTECTED]>

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to