On Wednesday, May 29, 2013 3:32:51 PM UTC+5:30, Fábio Santos wrote:
> On 29 May 2013 10:13, "RAHUL RAJ" wrote:
>
> >
>
> > Can anyone tell me the proper way in which I can execute dynamic MySQL
> > queries in Python?
>
> >
>
> > I want to do dynamic queries for both CREATE and INSERT statemen
On 29 May 2013 10:13, "RAHUL RAJ" wrote:
>
> Can anyone tell me the proper way in which I can execute dynamic MySQL
queries in Python?
>
> I want to do dynamic queries for both CREATE and INSERT statement.
>
> Here is my attempted code:
>
>
> sql="create table %s (%%s, %%s, %%s ... )" % (tablename
Can anyone tell me the proper way in which I can execute dynamic MySQL queries
in Python?
I want to do dynamic queries for both CREATE and INSERT statement.
Here is my attempted code:
sql="create table %s (%%s, %%s, %%s ... )" % (tablename,''.join(fields)+'
'.join(types))
cur.execute(sql)