Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing a variable to a sql statement 1

Status
Not open for further replies.

MrE4U

Programmer
Mar 29, 2003
11
0
0
US
I am trying to pass a variable to sql statement instead of a value.

This works

set result [db1 eval {SELECT * FROM phone_book WHERE id=1} ]

but this does not

set tst 1
set result [db1 eval {SELECT * FROM phone_book WHERE id=$tst} ]

Does anyone know how to fix this?

Thanks
 
Let's try:

set tst 1
set result [db1 eval "SELECT * FROM phone_book WHERE id=$tst" ]

Regards,
Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top