using CURRENT_TIMESTAMP

18 views
Skip to first unread message

Chris Nyland

unread,
Aug 15, 2014, 3:28:16 PM8/15/14
to pytho...@googlegroups.com
I like your library so for. Is very low level which is what I was looking for. However I ran into a problem. I want to construct a update query where I am setting the selected values to the SQL command "CURRENT_TIMESTAMP" and I can't seem to get it to work. I poke around in the source a little and tried the Literal class but none of those seemed to work. I was hoping you could tell me what I am missing. The query below is an example of what I am trying to create. I am using the library in the qmark mode as at the moment all my queries are feeding to the python sqlite3 module.

update main set test_column = CURRENT_TIMESTAMP


Cédric Krier

unread,
Aug 17, 2014, 1:01:56 PM8/17/14
to pytho...@googlegroups.com
You must use the function: CurrentTimestamp

main.update(columns=[main.test_column], values=[CurrentTimestamp()])

--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Chris Nyland

unread,
Aug 18, 2014, 7:30:16 AM8/18/14
to pytho...@googlegroups.com
OK got it. Initially I couldn't find it though so for any one else looking for this you need import the functions module.
Reply all
Reply to author
Forward
0 new messages