如何使用特殊字符将HANA SELECT运行到DUMMY?

2020-08-16 16:59发布

点击此处---> 群内免费提供SAP练习系统(在群公告中)加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)我在HANA中有一个查询,看起来...

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

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


我在HANA中有一个查询,看起来像这样:

 SELECT N'111 15€标记桑德河畔古琴!  ??。msg ACTIVITY'AS" U_ValueOfKeys" from DUMMY 

失败

语法错误或访问冲突; 257 sql语法错误:" 111 15€Gutschein am Tag des Wanderns!??。msg ACTIVITY"附近的语法不正确:第9行149列(位置852)

如果没有特殊字符,此命令将正确运行。 这是用户输入的。

这将是解决方案或解决方法? 有什么办法可以逃脱这些特殊字符?

4条回答
Alawn_Xu
2020-08-16 17:43
 ERROR | 2020-04-15 13:40:27.4979
 异常:执行查询时出现System.Runtime.InteropServices.COMException
 插入" COMPANY"。" @ COR_CLOUD_SEND"("代码","名称"," U_Id"," U_ObjType"," U_TransType"," U_NrOfKeys"," U_NameOfKeys"," U_ValueOfKeys"," U_FullSyncId"," U_Database"  ," U_XMLData")
 选择" Id"," Id"," Id"," U_ObjType"," U_TransType"," U_NrOfKeys"," U_NameOfKeys"," U_ValueOfKeys"," AS" U_FullSyncId",CURRENT_SCHEMA AS" U_Database",NULL AS" U_XMLData"  "
 从
 (SELECT RIGHT('000000000000000000000000000000'|| CAST(M。" MaxId" +" RowIndex" AS NVARCHAR),30)AS" Id"," U_ObjType"," U_TransType"," U_NrOfKeys"," U_NameOfKeys"," U_ValueOfKeys"
 从
 (超过ROW_NUMBER()(按T1排序。" U_ObjType")为" RowIndex"," U_ObjType"," U_TransType"," U_NrOfKeys"," U_NameOfKeys"," U_ValueOfKeys"
 从
 (
 选择N'ATTACHMENT'AS" U_ObjType",N'D'AS" U_TransType",4 AS" U_NrOfKeys",N'AbsEntry FileName KeyValue3NotUsed RefObjType'AS" U_NameOfKeys",N'111 15€Gutschein是Tag des Wanderns!  .msg ACTIVITY'AS" U_ValueOfKeys",NULL AS" U_XMLData" FROM DUMMY
 )T1)T2,
 (SELECT COALESCE(MAX(CAST(" Code" AS INT)),0)" MaxId"来自" COMPANY"。" @ COR_CLOUD_SEND"长度(LTRIM(" Code",'0123456789'))= 0)M)T3
 节点内容:TransactionId:'000000000000000000000000069090'/ObjectType:'221'/TransactionType:'Update'/NumberOfKeys:'1'/NameOfKeys:'AbsEntry'/ValueOfKeys:'111'/FullSyncId:''/DatabaseName:'COMPANY'/ UploadPriority'-100'/上游支持:True/XmlData:
 System.Exception:异常:执行查询时出现System.Runtime.InteropServices.COMException
 插入" COMPANY"。" @ COR_CLOUD_SEND"("代码","名称"," U_Id"," U_ObjType"," U_TransType"," U_NrOfKeys"," U_NameOfKeys"," U_ValueOfKeys"," U_FullSyncId"," U_Database"  ," U_XMLData")
 选择" Id"," Id"," Id"," U_ObjType"," U_TransType"," U_NrOfKeys"," U_NameOfKeys"," U_ValueOfKeys"," AS" U_FullSyncId",CURRENT_SCHEMA AS" U_Database",NULL AS" U_XMLData"  "
 从
 (SELECT RIGHT('000000000000000000000000000000'|| CAST(M。" MaxId" +" RowIndex" AS NVARCHAR),30)AS" Id"," U_ObjType"," U_TransType"," U_NrOfKeys"," U_NameOfKeys"," U_ValueOfKeys"
 从
 (超过ROW_NUMBER()(按T1排序。" U_ObjType")为" RowIndex"," U_ObjType"," U_TransType"," U_NrOfKeys"," U_NameOfKeys"," U_ValueOfKeys"
 从
 (
 选择N'ATTACHMENT'AS" U_ObjType",N'D'AS" U_TransType",4 AS" U_NrOfKeys",N'AbsEntry FileName KeyValue3NotUsed RefObjType'AS" U_NameOfKeys",N'111 15€Gutschein是Tag des Wanderns!  .msg ACTIVITY'AS" U_ValueOfKeys",NULL AS" U_XMLData" FROM DUMMY
 )T1)T2,
 (SELECT COALESCE(MAX(CAST(" Code" AS INT)),0)" MaxId"来自" COMPANY"。" @ COR_CLOUD_SEND"长度(LTRIM(" Code",'0123456789'))= 0)M)T3  ---> System.Runtime.InteropServices.COMException:1)。  [SAP AG] [LIBODBCHDB32 DLL] [HDBODBC32]语法错误或访问冲突; 257 sql语法错误:" 111 15€Gutschein am Tag des Wanderns!??。msg ACTIVITY"附近的语法不正确:第9行149(at 852)  )


 bei SAPbobsCOM.IRecordset.DoQuery(String QueryStr)
 bei SAPB1Connector.DI.DataAccess.SqlQueryRunner.RunQueryOnDiRecordset(公司,字符串查询)
 --- Ende der internenAusnahmestapelüberwachung---


 服务器堆栈跟踪:
 bei SAPB1Connector.DI.DataAccess.SqlQueryRunner.RunQueryOnDiRecordset(公司,字符串查询)
 bei SAPB1Connector.DI.DataAccess.SqlQueryRunner.InternalExecuteNonQuery(字符串查询,对象[]参数)
 bei SAPB1Connector.DI.DataAccess.SqlQueryRunner.ExecuteNonQuery(SqlQuery sqlQuery)
 bei SAPB1Connector.DI.EventProcessor.AddEvent(ObjectNotificationInformation info)
 bei SAPB1Connector.DI.DIConnection.AddEvent(ObjectNotificationInformation info)
 bei SAPB1Connector.DI.Triggers.EventTriggerBase.AddEvent(String objectType,SapTransactionType transactionType,String [] nameOfKey,String [] valueOfKey)
 bei SAPB1Connector.DI.Triggers.Attachment.AttachmentTriggerBase.AddAttachmentEvent(SapTransactionType transactionType,AttachmentHistory附件)
 bei SAPB1Connector.DI.Triggers.Attachment.AttachmentGroupAddedOrUpdatedTrigger.Execute(CoreObjectDefinition triggerObjectDefinition,SapTransactionType transactionType,String [] ids)
 bei SAPB1Connector.DI.Triggers.EventTriggerBase.Execute(CoreObjectDefinition triggerObjectDefinition,SapTransactionType transactionType,String [] id,布尔值isInFullSyncMode)
 bei SAPB1Connector.DI.DIConnection。<> c__DisplayClass72_0。 b__0(IEventTrigger触发器)
 bei System.Collections.Generic.List`1.ForEach(Action`1 action)
 bei SAPB1Connector.DI.DIConnection.ExecuteTriggers(String objectType,SapTransactionType transactionType,String [] ids,布尔值isInFullSyncMode)
 bei SAPB1Connector.DI.DIConnectionProxy.ExecuteTriggers(String objectType,SapTransactionType transactionType,String [] ids,布尔值isInFullSyncMode)
 bei System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md,Object [] args,Object server,Object []&outArgs)
 bei System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage消息)


 异常重新抛出为[0]:
 bei SAPB1Connector.ConnectionProxy.HandleException(TargetInvocationException异常,Int32 tryCount)
 bei SAPB1Connector.ConnectionProxy.CallDIMethod(DiMemberCallParameters参数)
 bei SAPB1Connector.ConnectionProxy.CallDIMethod(字符串名称,对象[]参数,布尔值reconnectDI)
 bei SAPB1Connector.ConnectionProxy.ExecuteTriggers(String objectType,SapTransactionType transactionType,String [] ids,布尔值isInFullSyncMode)
 bei SAPB1Connector.ObjectsLogic.Uploader.ProcessEvents()
 

这是整个故事。

它使用COM互操作来运行上面的查询。

一周热门 更多>