Use of sqlite3_bind_int() vs sqlite3_bind_int64()

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Use of sqlite3_bind_int() vs sqlite3_bind_int64()

Paul
According to datatypes page https://sqlite.org/datatype3.html SQLite choses width of the integer automatically. Does it mean that if I let's say want to bind a number 5 in the query that inserts/updates rows it will be stored in database as 1-byte integer regardless of the use of sqlite3_bind_int() or sqlite3_bind_int64()?
If so, is it safe to *always* use sqlite3_bind_int64()/sqlite3_column_int64() and forget about pain int versions?
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Use of sqlite3_bind_int() vs sqlite3_bind_int64()

Richard Hipp-3
On 3/28/17, Paul <[hidden email]> wrote:
> According to datatypes page https://sqlite.org/datatype3.html SQLite choses
> width of the integer automatically. Does it mean that if I let's say want to
> bind a number 5 in the query that inserts/updates rows it will be stored in
> database as 1-byte integer regardless of the use of sqlite3_bind_int()
> or sqlite3_bind_int64()?

Correct.

> If so, is it safe to *always*
> use sqlite3_bind_int64()/sqlite3_column_int64() and forget about pain int
> versions?

Correct.

Also, always use sqlite3_malloc64() and sqlite3_realloc64() and
sqlite3_column_int64(), etc.
--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Use of sqlite3_bind_int() vs sqlite3_bind_int64()

Paul
Thank you very much for replying so quickly!
 

>   On 3/28/17, Paul  wrote:
> > According to datatypes page https://sqlite.org/datatype3.html SQLite choses
> > width of the integer automatically. Does it mean that if I let's say want to
> > bind a number 5 in the query that inserts/updates rows it will be stored in
> > database as 1-byte integer regardless of the use of sqlite3_bind_int()
> > or sqlite3_bind_int64()?
>
> Correct.
>
> > If so, is it safe to *always*
> > use sqlite3_bind_int64()/sqlite3_column_int64() and forget about pain int
> > versions?
>
> Correct.
>
> Also, always use sqlite3_malloc64() and sqlite3_realloc64() and
> sqlite3_column_int64(), etc.
> --
> D. Richard Hipp
> [hidden email]
 
 
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Loading...