Re: SQL problem in python

2008-03-08 Thread petr . jakes . tpc
Maybe you should try SQLObject :-) from sqlobject import * from sqlobject.sqlbuilder import Select #from sqlobject.sqlbuilder import * from datetime import datetime # === sqlite == #connection = connectionForURI('sqlite:///dev/shm/ourdata.db') connection = conne

Re: SQL problem in python

2008-03-08 Thread Carsten Haese
On Sat, 2008-03-08 at 10:11 -0800, Dennis Lee Bieber wrote: > On Sat, 8 Mar 2008 09:28:23 -0800 (PST), aiwarrior > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > Thanks a lot. > > In the Python documentation, the sqlite module documentation doesn't > > mention that special

Re: SQL problem in python

2008-03-08 Thread aiwarrior
Thanks a lot. In the Python documentation, the sqlite module documentation doesn't mention that special rule. I really thought that every variable to be included in a query had to use that special method. Again thanks a lot -- http://mail.python.org/mailman/listinfo/python-list

Re: SQL problem in python

2008-03-08 Thread Peter Otten
aiwarrior wrote: > When i run it the get_value() returns 'filepath' instead of the > columns. But if i dont use any variable and make the expression static > all goes on as its supposed to. What am i doing wrong? > self.cursor.execute( "SELECT (?) FROM database", column ) In this case yo

Re: SQL problem in python

2008-03-08 Thread Carsten Haese
On Sat, 2008-03-08 at 08:57 -0800, aiwarrior wrote: > def get_value( self, column ): > self.cursor.execute( "SELECT (?) FROM database", column ) > for n in self.cursor: > print n > > When i run it the get_value() returns 'filepath' instead of the > columns. But if

SQL problem in python

2008-03-08 Thread aiwarrior
class db: def __init__(self): #constructor conn = sqlite3.connect(":memory:") conn.isolation_level = None self.cursor = conn.cursor() self.cursor.execute("CREATE TABLE database (album,filepath)") def add_entry(self, eone , etwo): #Add entry to database