On Fri, Oct 24, 2008 at 02:49:14AM -0700, dbikash scratched on the wall:
> 
> Hi,
> 
> I am using tinyint in my schema, but while doing paramterized insertion, I
> find that there is no specific bind API to insert a tinyint. So I used int
> sqlite3_bind_int() instead.
> 
> However, the size of my database suggests that SQLite might actually be
> using 4 bytes instead of 1. Is it? How can I insert tinyint's in a
> parameterized query so that it takes only 1 byte of space?

  As with strings, SQLite automatically adjusts the size of the
  stored integer to match the magnitude of the value.  All integers
  are signed, and SQLite supports sizes of 1-4, 6, or 8 bytes.

  As long as your values are within the range of -128 to +127, your
  integers will only take one byte of storage (plus common overhead).
 
    -j
  
-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Our opponent is an alien starship packed with atomic bombs.  We have
 a protractor."   "I'll go home and see if I can scrounge up a ruler
 and a piece of string."  --from Anathem by Neal Stephenson
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to