Hello all,
 
Maybe what I want is not possible or maybe I'm just not doing it right,
so I wanted to ask... Thank you in advance for your answers.
 
I'm converting sqlite3_mprintf() into sqlite3_prepare_v2() and the SQL
for that was like this:
 
"SELECT *, Table1.ID AS _ID FROM Table1 LEFT JOIN Table2 ON
Table2.ID=Table1.ID %s"
 
and I was putting a "WHERE _ID=1", for example, in the %s
 
Now, I'm trying to do the same:
 
"SELECT *, Table1.ID AS _ID FROM Table1 LEFT JOIN Table2 ON
Table2.ID=Table1.ID ?1"
 
and then sqlite3_bind_text(pStmt,1,"WHERE _ID=1",-1,SQLITE_STATIC), but
it returns a NULL pStmt and says that the syntax is wrong near ?1
 
My question is, can I do it like this or do I have to something like:
 
"SELECT *, Table1.ID AS _ID FROM Table1 LEFT JOIN Table2 ON
Table2.ID=Table1.ID WHERE _ID=?1" and bind only the _ID parameter in
this case? The issue is that I don't know beforehand what can be in that
WHERE statement and how many parameters it might have - it's formed
elsewhere.
 
Thanks again for reading.
 
Best regards,
 
   Dennis


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to