MySQL Forums
Forum List  »  Connector/Python

Re: How to execute SELECT command with WHERE clause
Posted by: Lalit Shakya
Date: June 25, 2010 07:26PM

sql="SELECT Gene_name FROM cneviewer WHERE CNE_ID = '%s'", % 'CNS'


try:
# Execute the SQL command
cursor.execute(sql)
# Fetch all the rows in a list of lists.
results = cursor.fetchall()

except:
print "Error: unable to fecth data"


Try to use this one it may be helpful to u

Options: ReplyQuote


Subject
Written By
Posted
Re: How to execute SELECT command with WHERE clause
June 25, 2010 07:26PM


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.