Trying to extract data through bind variables in cx_oracle python

94 Views Asked by At

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

1

There are 1 best solutions below

0
Christopher Jones On

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