1
我有一個包含超過100列和行的數據庫(postgresql)。表中的一些單元格是空的,我使用python進行腳本編寫,因此None值放置在空單元格中,但是當我試圖插入表格時,它顯示以下錯誤。無法在postgres中使用psycopg2插入無值
使用psycopg2作爲蟒-postgres的接口............任何建議" psycopg2.ProgrammingError: column "none" does not exist"
上午??
在此先感謝......
這裏是我的代碼: -
list1=[None if str(x)=='nan' else x for x in list1];
cursor.execute("""INSERT INTO table VALUES %s""" %list1;
);
Python不會*需要使用';'分號。 –
'list1'只保存**一個**值嗎?或者你是否嘗試將其用於多次插入? –