1

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

1 Answer 1

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
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.