[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sqlite-users
Subject:    Re: [sqlite] What are the correct bind parameters for empty string
From:       Richard Hipp <drh () sqlite ! org>
Date:       2016-09-20 1:08:11
Message-ID: CALwJ=MzNhu6zP9kCA-+HGvvJ+N=FzJY-B_dBvobA1xCOSe8qCQ () mail ! gmail ! com
[Download RAW message or body]

On 9/19/16, Robert E. Pappenhagen <repappenhagen@ra.rockwell.com> 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
drh@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic