从python sqlalchemy调用过程时出错

2020-08-22 05:37发布

点击此处---> 群内免费提供SAP练习系统(在群公告中)加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)嗨 当我使用sqlalchem...

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


当我使用sqlalchemy lib从表类型输入和python的varchar out参数调用存储过程时遇到错误。以下是错误

从python sqlalchemy.exc.DatabaseError调用过程时出错:(pyhdb.exceptions.DatabaseError)无效参数:输入参数不足以作为表参数:

第一个参数是表类型,第二个参数是varchar

我正在添加尝试使用的代码段

 engine = create_engine(" hana + pyhdb://{username}:{password} @ {host}:{port}"。format(username ='username',password ='password',host ='hostname'  ,port ='30015'))
 output ="
 数据='[{" RULE_ID":1," RULE_NAME":null," SO_SSA":" 1074"," PO_NUMBER":null," CODE":" DDD"," ROUTE_CODE":""," OPERATING":  null," SHIP_TO":" IND"," SHIP_TO_REGION":" MX"," SHIP_TO_CUSTOMER_ID":null," BILL_TO_CUSTOMER_ID":null," END_TO_CUSTOMER_ID":null," SLCA":" AKP123"," HOLD_NAME":" 批准保留"," SHIPPING_PREFERENCE":null," EAD":null," CUSTOMER_REQUEST_TYPE":null," CRD":null," CRSD":null," CURRENT_PROMISE_DATE":null," CURRENT_PROMISE_DELIVERY_DATE"" ATE:null"  null," OPDD":null," ON_HOLD":null," FLOW_STATUS_CODE":null," PICK_RESULT":null," IS_IN_OTM":null," BUSINESS_UNIT":null," REVENUE_FLAG":null," ACTION_CATEGORY":null,  " ACTION_OWNER":null," SS_REVENUE":null," CARTONS":null," INVOICE_ELIGIBILITY_EVENT":null," SALES_CHANNEL":null," CREATED_BY":" NEW"," CREATION_DATE":" 2020-02-11 10:  24PM"," LAST_UPDATED_BY":" NEW"," LAST_UPDATE_DATE":" 2020-03-04 10:39 PM"," FDA_FLAG":null," POE_FLAG":null," CONSOLIDATED_FLAG":null," START_DATE":" 2019  -01-02"," END_DATE":" 2020-01-02"," ACTIVE":" T"}]]'

 test = engine.execute('call SCHEMA.PROC(?,?)',(数据,输出))
 
4条回答
葫芦娃快救爷爷
2020-08-22 06:01

感谢您访问SAP社区以获取问题的答案。 由于您是第一次在这里提出问题,因此建议您熟悉 https ://community.sap.com/resources/questions-and-answers (如果您还没有的话),因为它提供了准备问题的技巧,这些问题引起了我们成员的回响。

如果您愿意,可以先选择"操作",然后再"编辑"来修改您的问题(尽管一旦有人回答了您的问题,您将失去编辑问题的能力-但是,如果发生这种情况,您可以在" 评论)。

-Jerry

一周热门 更多>