我正在閱讀這樣的表格:
query = (
"select mandant,posnr,systemdat,
"lieferbedingung,loeschhafen,bereich,"
"nrkreis_nr from eakopf_t where posnr[10,10] = \" \" and posnr[1,2] not in (\"99\",\"RE\",\"UB\") and mandant <> 999;"
)
df = pd.read_sql(query, engine.connect())
但我收到此錯誤:
ibm_db_dbi::DatabaseError: SQLNumResultCols failed: [IBM][CLI Driver][IDS/UNIX64] Column ( ) not found in any table in the query (or SLV is undefined). SQLCODE=-217
[SQL: select mandant,posnr,systemdat,lieferbedingung,loeschhafen,bereich,nrkreis_nr from eakopf_t where posnr[10,10] = " " and posnr[1,2] not in ("99","RE","UB") and mandant <> 999;]
是否可以進一步除錯導致問題的確切 col?因為否則,所有 col 名稱似乎都存在于資料集中。
uj5u.com熱心網友回復:
有點猜測,因為我看不到你的資料庫,但這一行:
posnr[10,10] = " "
對我來說是可疑的。至少在 Postgres 中,雙引號表示列名,這會給你這樣的錯誤。我建議用單引號替換任何用于表示字串的雙引號,然后再試一次。IE)
posnr[10,10] = ' '
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/312998.html
