0

Hello all,

Is there any algorithm to convert a python tuple to MySql query.

Ex:

('*','name','sliver')

should convert to

select [Pri_Key] from [All Tables] where 'name' = 'sliver';

I have been able to do so ... but my algorithm looks very ugly and have to process everything bit by bit.

The query becomes even more complex when i have nested tuples.


Any Ideas?

2
Contributors
1
Reply
2
Views
10 Years
Discussion Span
Last Post by sharma_vivek82
0

hi,
as i got you , i think the better way you can use is :

qry = "select %s from %s where %s" %(name,table,filter)

and then you can create your own method to run sql

-VS

Hello all,

Is there any algorithm to convert a python tuple to MySql query.

Ex:

('*','name','sliver')

should convert to

select [Pri_Key] from [All Tables] where 'name' = 'sliver';

I have been able to do so ... but my algorithm looks very ugly and have to process everything bit by bit.

The query becomes even more complex when i have nested tuples.


Any Ideas?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.