Help - Metadata variable passing parameters to DML queries

arflores1 at arflores1 at
Thu Nov 9 01:54:07 CET 2000


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')



More information about the Python-list mailing list