第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

字符串格式化程序上的python psycopg2內(nèi)部錯誤

字符串格式化程序上的python psycopg2內(nèi)部錯誤

慕桂英3389331 2021-03-29 13:50:02
嗨,我正在嘗試以下腳本import psycopg2 as pqimport os# Create the databaseos.system('dropdb ptest')os.system('createdb ptest')# connect to the databasecn = pq.connect('dbname=ptest user=myname')cr = cn.cursor()# the wierd tuple at the EOL below is to preserve the list # lookup in case that is where the error is.cr.execute('CREATE TABLE id1 (%s varchar, %s int PRIMARY KEY, %s int, %s int, %s varchar)' % tuple(['fund', 'sleeve_id', 'sub_id', 'level_id', 'Entity_id'])cr.execute('INSERT INTO id1 (%s,%s,%s,%s,%s) VALUES ("%s","%s","%s","%s","%s");' % tuple(['fund', 'sleeve_id', 'sub_id', 'level_id', 'Entity_id']+['RHUBARB RHUBARB - RHUBARB RHUBARB', '2', '1', '1', 'CRUMB1']))我得到了錯誤Traceback (most recent call last):  File "<stdin>", line 1, in <module>  File "<string>", line 1, in <module>psycopg2.InternalError: current transaction is aborted, commands ignored until end of transaction block我究竟做錯了什么?順便說一句,行發(fā)生相同的錯誤cr.execute('INSERT INTO id1 (%s,%s,%s,%s,%s) VALUES ("%s","%s","%s","%s","%s");' % ('fund', 'sleeve_id', 'sub_id', 'level_id', 'Entity_id','RHUBARB RHUBARB - RHUBARB RHUBARB', '2', '1', '1', 'CRUMB1'))
查看完整描述

2 回答

  • 2 回答
  • 0 關注
  • 316 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號