0
cursor = connection.cursor()
cursor.execute("UPDATE public.rsvp SET status=TRUE WHERE rsvp_id=%s", [rsvp_id])
cursor.execute("SELECT status, rsvp_id FROM public.rsvp WHERE rsvp_id=%s", [rsvp_id])
row = cursor.fetchall()
當我在我的Django項目執行此,我得到的返回行,因爲我希望看到它,但後來當我選擇查詢同一行,看來因爲聲明從未真正運行過。在我的代碼中,列「status」默認爲NULL。運行後,我仍然在我的表格中看到NULL。如何提交一個更新的原始SQL在python
對不起,這是Postgres – stupidkid 2013-03-14 17:20:54