MySQL Forums
Forum List  »  Connector/Python

SQL SYNTAX ERROR IN PYTHON CODING
Posted by: Sampath Girish Munagala
Date: April 15, 2009 06:46AM

Hi Guys,
I got stuck up with a problem. I need to display a list of tables in the grid by entering an alphabet and click submit.
For e.g., If i need to display only the records starting with 'sam', i will enter 'sam' in the entry and press submit. So it must display all the records starting with 'sam'.
Below one is the syntax which i typed in python coding. But its displaying error.

no = cur.execute("select * from project.inv_list where Product_name like %s%",(a1))

I typed the following syntax in MySQL, it worked.

select * from project.inv_list where Product_name like 'sam'%

Options: ReplyQuote


Subject
Written By
Posted
SQL SYNTAX ERROR IN PYTHON CODING
April 15, 2009 06:46AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.