On Mar 12, 2008, at 11:40 PM, Mike Marshall wrote:

> Hi all
>
>
>
> I'm trying to get param binding working and I'm obviously doing  
> something
> wrong
>
>
>
> My code is
>
>
>
> acQuery = sqlite3_mprintf("SELECT rowid FROM fulltext_%s WHERE  
> contents
> MATCH '? '",sTempTableRoot.c_str());

Don't put quotes around the ? character. ('? ') is a literal string. You
probably want (? || ' ') - an SQL variable with a single space appended
to it.

Dan.



>
> nError = sqlite3_prepare_v2(m_pHandle,acQuery,-1,&pStatement,NULL);
>
> nError =
> sqlite3_bind_text(pStatement,1,m_sQuery.c_str(),-1,SQLITE_TRANSIENT);
>
>
>
> nError from the prepare is SQLITE_OK but from the bind its  
> SQLITE_RANGE
>
>
>
> Anyone got any ideas where I'm going wrong, or is it the fact that I'm
> trying to do a bind on a MATCH (fts) that is giving me the problem.
>
>
>
> Any and all help gratefully received
>
>
>
> Mike
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to