On Wed, Sep 03, 2008 at 04:46:37PM -0700, Joanne Pham scratched on the wall:
> Hi All,
> I have an application which is used one of the variable is "long long int".
> This variable is used for storing the big number and
> I used  sqlite3_bind_int to bind this variable. One for while I have
> seen the negative number in the database for this variable.
> It seems like this variable is overloaded. The sqlite3_bind_int didn't
> work in this case.
> I have read the sqlite'document and found that there are two other
> binding function sqlite3_bind_int64, sqlite_uint64 to bind the columns.
> Which function (sqlite3_bind_int64, sqlite_uint64 ) for me to use if my
> datatype is long long int in C++

  Neither C nor C++ define the specific sizes of different types.
  Therefore, "long long int" can be different sizes on different
  platforms, or even within different compilers for the same platform.
  Without more information, we cannot say for sure if a "long long int"
  is 64 bits or not on your platform.

  However, most modern desktop systems _do_ define "long long int" to be a
  64 bit integer.   If you want to find out, just look at the return value
  from "sizeof(long long int)"-- if it is 8, then it is 64 bits.
  
  Regardless, it is extremely unlikely to be greater than 64 bits, so
  using sqlite_bind_int64() (which does define an explicit 64 bit
  integer) should be able to hold anything a "long long int" can hold.
  The compiler should do any required conversion if "long long int" is
  some other size.

   -j

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"'People who live in bamboo houses should not throw pandas.' Jesus said that."
   - "The Ninja", www.AskANinja.com, "Special Delivery 10: Pop!Tech 2006"
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to