CrazyPython22
CrazyPython22

Reputation: 11

Trying to extract data through bind variables in cx_oracle python

I am trying execute below block of code with cx_oracle by bind variables, but getting below mentioned error everytime. Not sure what is missing.

Anyone has idea on this

Code :

a = input("Please enter your name ::")

conn = cx_Oracle.connect('hello/123@oracle') cur = conn.cursor()

text1 = "select customer from visitors where name = :myvalue;" cur.execute(text1,myvalue=str(a))

ERROR observed : cx_Oracle.DatabaseError: ORA-00933: SQL command not properly ended

Upvotes: 0

Views: 99

Answers (1)

Christopher Jones
Christopher Jones

Reputation: 10621

Remove the semi-colon at the end of your SQL statement.

Upvotes: 0

Related Questions