| | |
Python tuples and Sql query
Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
![]() |
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?
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?
•
•
Join Date: Mar 2006
Posts: 18
Reputation:
Solved Threads: 0
hi,
as i got you , i think the better way you can use is :
and then you can create your own method to run sql
-VS
as i got you , i think the better way you can use is :
Python Syntax (Toggle Plain Text)
qry = "select %s from %s where %s" %(name,table,filter)
-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?
Best wishes,
Vivek Sharma
Zope/Python Developer
Vivek Sharma
Zope/Python Developer
![]() |
Similar Threads
- sql query problem with MS Access and C# (C#)
- Urgent Help with SQL Query (MySQL)
- C# VS 2005 - SQL Query Parameters to an ODBC DataSource (C#)
- sql query updating problem (Visual Basic 4 / 5 / 6)
- Javascript array from sql query (JSP)
- Please help me out with MySQL query (MySQL)
- PHP/SQL query help (PHP)
- Retreiving variables from a sql query into a form (PHP)
Other Threads in the Python Forum
- Previous Thread: Stuck in GUI
- Next Thread: Find a word in a file
Views: 3023 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for Python
anti array avogadro beginner builtin clear client code color count csv curved def dictionary dynamic enter examples excel file float format frange ftp function gui heads hints homework import input java lapse line lines linux list lists loop microcontroller mouse multiple mysqldb mysqlquery newb number numbers output parsing path port prime program programming projects py2exe pygame pyopengl pyqt python random raw_input recursion recursive redirect script scrolledtext singleton software sqlite ssh stderr string strings subprocess sum syntax table terminal text thread threading time tkinter tlapse tooltip tuple tutorial twoup ubuntu unicode unix urllib urllib2 variable web-scrape wikipedia windows word wx.wizard wxpython





