Reputation: 11
I am running following command to fetch data of particular customer but output comes out to be null or no data found, while data is already stored in the table. Can anyone identify the problem
custid=input("Enter CustomerID:")
cur.execute("""SELECT * FROM INFYCAMPUSCONNECT.CUSTOMER WHERE CUSTOMERID= :1 """ , (custid))
Upvotes: 0
Views: 47
Reputation: 781731
The parameters need to be a tuple, so you have to put a comma in the parentheses:
cur.execute("""SELECT * FROM INFYCAMPUSCONNECT.CUSTOMER WHERE CUSTOMERID= :1 """ , (custid,))
Upvotes: 2