SQL SELECT question...

AMR alvaro at ocse.infonegocio.com
Fri May 19 07:01:31 EDT 2000


I think you have to do something like this:

cursor.execute("SELECT someField FROM someTable WHERE
someField='someString' ")
or
cursor.execute("SELECT someField FROM someTable WHERE  someField='%s' " %
SomeThing)

It works for me,

I hope it helps,
--
Alvaro Martínez
alvaro at ocse.infonegocio.com

"richard_chamberlain" <richard_chamberlain at ntlworld.com> escribió en el
mensaje news:do4V4.18$1W6.395 at news2-win.server.ntlworld.com...
> Rob,
>
> Your statement is correct - in what way doesn't it work - do you get an
> error or just no data returned?
>
> Richard
>
> Rob Elder <relder at omegabit.com> wrote in message
> news:relder-1805001834470001 at s03.best1.net...
> > Hello, guys
> >
> >    I'm struggling with using SQL with Python. One question please. How
> > should I structure the following operation using odbc:
> >
> >
> > cursor.execute('SELECT someField FROM someTable WHERE
> someField="someString"')
> >
> >
> > This does not work for me. How is this supposed to be structured?
> >
> > TIA.
> >
> > -r
>
>





More information about the Python-list mailing list