On Thu, 3 Jan 2008 16:57:12 -0800, Jerry Krinock
<[EMAIL PROTECTED]> wrote:

>I need to read an sqlite database generated by others.  So I wrote an  
>outer loop which steps through the rows of a table using sqlite3_step,  
>and an inner loop which steps through the columns.  The inner loop  
>finds the type using sqlite3_column_type(), then 'switches' to get the  
>value using the appropriate sqlite3_column_XXXXX() function.
>
>It works fine if, when encountering an SQLITE_INTEGER type, I use  
>sqlite_column_int64() to get the data.
>
>I don't know whether or not I'm just "lucky" that the application  
>which wrote the database uses 64 bit for all of its integers?  If so,  
>what if someone throws a 32-bit integer at me someday?  How can I tell  
>whether integer data objects in a table are 32 or 64 bit?  The column  
>specifications I get from pragma_table_info() are likewise  
>uninformative, saying simply type=INTEGER.
>
>Thanks again,
>
>Jerry Krinock

If I understand the info at
        http://www.sqlite.org/c3ref/c_blob.html
well, the INTEGER is always a 64-bit signed integer.
Internally, integers are compressed, so they don't occupy eight
bytes all the time.

sqlite3_column_int64(); will always return a sqlite3_int64.
So, no need to worry.
-- 
  (  Kees Nuyt
  )
c[_]

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to