Re: [sqlite] What are the correct bind parameters for empty string

2016-09-19 Thread Richard Hipp
On 9/19/16, Robert E. Pappenhagen  wrote:
> I have a table with a not null column...
>
> Some of the values are empty string and some have more lengthy values :-)
>
> I prepare a statement ("Select col2 from table where column = ?") and then
> use bind to that parameter what are the parameters ?
>
> From slq browser I can "Select col2 from table where column = "" and get the
> empty string rows - so I know they are there
> sqlite3_bind_text(stmt, 1, "", 0, SQLITE_ STATIC) ?
>
> sqlite3_bind_text(stmt, 1, "", -1, SQLITE_ STATIC) ?

They should both work.  The first might be very slightly faster by
avoiding a call to strlen().

-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] What are the correct bind parameters for empty string

2016-09-19 Thread Robert E. Pappenhagen
I have a table with a not null column...

Some of the values are empty string and some have more lengthy values :-)

I prepare a statement ("Select col2 from table where column = ?") and then use 
bind to that parameter what are the parameters ?

From slq browser I can "Select col2 from table where column = "" and get the 
empty string rows - so I know they are there
sqlite3_bind_text(stmt, 1, "", 0, SQLITE_ STATIC) ?

sqlite3_bind_text(stmt, 1, "", -1, SQLITE_ STATIC) ?

I'm stuck
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users