當前位置:成語大全網 - 新華字典 - python使用oracle查詢數據庫,查詢語句中使用變量值

python使用oracle查詢數據庫,查詢語句中使用變量值

cursor.execute('select * from INV.MTL_ITEM_REVISIONS where ROW_ID= %s'% (Item,))

換為:

qry_sql = "select * from INV.MTL_ITEM_REVISIONS where ROW_ID= '%s'" % Item

cursor.execute(qry_sql)