Help - Metadata variable passing parameters to DML queries
arflores1 at earthlink.net
arflores1 at earthlink.net
Wed Nov 8 19:54:07 EST 2000
Hi,
I'm a newbie in python needing some help to overcome my frustration
in breaking my learning curve with Python. I can't get a good grip
on how to code the right syntax for passing variable to a Select,
Insert, Update and Delete. Here's a sample code that I'm trying to
solve its based on a database metadata concepts.
Here's the sample code
mColumn1 = 'PK_ID'
mColumn2 = 'Name'
mColumn3 = 'Phone'
mFrom = 'Person'
mWhere = 'Email'
import dbi
import odbc
What is the correct Select syntax coding for this stuff based on my
input variable defination.
mCursor.execute('Select %(mColumn1)s, %(mColumn2)s, %(mColumn3)s\
From %(mFrom)s\
Where %(mWhere)s')
Thanks
Alex
More information about the Python-list
mailing list