0

How can I use a variable in an SQLite query?

select tom from test; #tom is a field in my database,it is ok  

How can I express the meaning?

name="tom"  
select  name from test;  
Sj Bq
  • 201
  • 3
  • 6
  • `select tom from test` looks awfully suspicious... Do you mean `SELECT Name, Address, City FROM test WHERE Name = 'Tom'` ? – mjv Nov 10 '12 at 02:46
  • Not enough information / Depends upon language/binding / SQLite itself *does not* support a declarative language as found in other SQL dialects like PL/SQL, PL/pgSQL or TSQL - see also http://stackoverflow.com/questions/7739444/declare-variable-in-sqlite-and-use-it , http://stackoverflow.com/questions/5619145/sqlite-variables depending upon real issue. –  Nov 10 '12 at 03:31
  • From which language are you accessing SQLite? – CL. Nov 10 '12 at 11:26

0 Answers0