Aniket Jain
Aniket Jain

Reputation: 11

sql select query issue in python

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

Answers (1)

Barmar
Barmar

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

Related Questions