On Jan 18, 2008, at 10:59 AM, Hermann Himmelbauer wrote:
> > Hi, > I have a table that looks appr. like this (I deleted some columns): > > table_acc = Table( > 'konto', metadata, > Column('kontoid', Integer, primary_key=True, key='accid'), > Column('erdat', DateTime, default=func.now(), key='datopen')) > > What I'd like to accomplish is that when during an insert the value > for the > column "erdat" is None, the current time should be inserted. But > when I try > to insert data, the following error is raised: > > File "/home/dusty/prog/python_modules/sqlalchemy/engine/base.py", > line 935, in > _handle_dbapi_exception > raise exceptions.DBAPIError.instance(statement, parameters, e, > connection_invalidated=is_disconnect) > OperationalError: (OperationalError) no such function: now > u'INSERT INTO > konto (kontonr, ktobez, kapital, disposal, ktogeb, gebuehren, > rahmen, erdat, > datlabs, standlabs, ktostatus, datsal, waehrungid) VALUES > (?, ?, ?, ?, ?, ?, ?, now(), now(), ?, ?, ?, ?)' > ['999999995', 'Bankkonto', '0000000001000.50', '1000000001000.50', > '000000000.00', '000000000.00', '000000000.00', '0000000000000.00', > 'A', > None, 1] > > What can I do about this? It seems, that "now()" is not recognized, > but how is > this possible? > > I am using SA 0.4.1, SA0.4.2p3 + Python-2.4.4 and sqllite. > with sqlite use func.current_timestamp() instead of now(). --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---