sqlite supports parsing parameters for you:
$ cur.execute("select name from people where age=?;", (age,))
How can I access the resulting parsed sql? Something like:
$ age = 18
$ cur.format("select name from people where age=?;", (age,))
"select name from people where age=18;"
asked Feb 14, 2012 at 3:32
hoju
29.7k41 gold badges138 silver badges178 bronze badges
1 Answer 1
You can't. There is no resulting sql to access because the query is never assembled into a single string. The sqlite library receives the sql string and the parameters separately.
answered Feb 14, 2012 at 4:09
Francis Avila
31.8k7 gold badges63 silver badges99 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
default