0

I am completely lost here:

v_sql = "SELECT widget_name, widget_url FROM widget_calls WHERE widget_name = :widget"
cursor.execute(v_sql, widget=widget_name)
df_wid = pd.read_sql(v_sql, con=connection)

Result:

pandas.io.sql.DatabaseError: Execution failed on sql 'SELECT widget_name, widget_url FROM widget_calls WHERE widget_name = :widget': ORA-01008: not all variables bound

There is 1 bind variable, :widget, and 1 declaration in the execute. So, what am I missing?

1 Answer 1

1

The cursor.execute call and the pd.read_sql call are completely unrelated. You're doing the query twice, and throwing away the first result. I would delete the useless cursor.execute.

And for read_sql, you need:

df_wid = pd.read_sql( v_sql, con=connection, params={'widget': widget_name})
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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.