Re: [sqlite] About sqlite3_bind

2008-11-11 Thread yoky
A parameter represents a literal. You can't bind a column name. After binding, your query is equivalent to select 'ID','age','name' from tbl1 where ID=1; > The return value of sqlite3_step(stat) was SQLITE_ROW, but the > values I got were 0, > why? Because the value of the column is a

Re: [sqlite] About sqlite3_bind

2008-11-10 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 yoky wrote: > I create a table with 200 columns, If you have that many columns but want queries with only some of them, then it is a good indication that your schema is not normalized. See the wikipedia entry for some guidance:

Re: [sqlite] About sqlite3_bind

2008-11-10 Thread Igor Tandetnik
"yoky" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I try to select like this: >sqlite3_prepare(db, "select ?,?,? from tbl1 where ID=1", -1, > , 0); >sqlite3_bind_text(stat, 1, "ID", -1, 0); >sqlite3_bind_text(stat, 2, "age", -1, 0); >