PYTHON: SQL QUERY

Harry George hgg9140 at cola.ca.boeing.com
Wed Jun 13 14:47:12 EDT 2001


This is probably a database newsgroup question.  Also, you haven't
given enough information to allow much feedback.  Still, here are some
ideas:

Assume you are using a DBI 2.0 compliant interface.  You have
generated a database connection and a cursor "c".  The database has a
table product=(code,name,price).


c.execute("select name,price from product where code=%s",code)
rows=c.fetchall()
for (name,price) in rows:
    #do something


vgiquel at yahoo.fr (=?ISO-8859-1?Q?Val=E9rie?=) writes:

> Bonjour,
> 
> Nous sommes actuellement face à un probleme:
> Nous devons saisir un code produit dans une Entry. Ensuite, nous
> devons recuperer cette valeur pour ensuite afficher dans une nouvelle
> fenetre les donnees correpondant à ce code produit.
> Avez vous la solution?
> 
> Merci
> 
> 
> Hello,
> 
> we have got a problem:
> We want to enter a code of product in an Entry. After, we want to
> recuperate this value for print the correspondant datas in relation
> to this code of product.
> Have you got a solution please?
> 
> Thanks a lot
> 
> Valérie & Solenn

-- 
Harry George                E-mail:  harry.g.george at boeing.com
The Boeing Company          Renton:  (425) 237-6915
P. O. Box 3707  02-CA       Everett: (425) 266-3868
Seattle, WA 98124-2207      Page:    (425) 631-8803  



More information about the Python-list mailing list