简体   繁体   English

通过JMeter调用DB2存储过程时的语法错误

[英]Syntax Error While Calling DB2 Stored Procedure Through JMeter

I am trying to call a DB2 Stored Procedure which has two Input parameters (Timestamp, both) and one Output parameter (Integer). 我试图调用一个DB2存储过程,该存储过程具有两个Input参数(两个均为Timestamp)和一个Output参数(为Integer)。 I am trying to do so from JMeter JDBC Sampler and getting sql syntax exception. 我正在尝试从JMeter JDBC Sampler这样做,并获取sql语法异常。

Response code: 42884 -440
Response message: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-440, SQLSTATE=42884, SQLERRMC=PROCEDURE;DEVSCHEMA.GET_ROW_COUNT, DRIVER=4.19.26

Response headers:
1272084586, URL=jdbc:db2://<db2IP>:<port>/DB2T, UserName=<someUserName>, IBM Data Server Driver for JDBC and SQLJ 

From IBM Documentation I got to know that this error happens when either Stored procedure is not present - which is not the case, Schema name incorrect - which is also not the case, mismatching number of parameters - I verified this but I am doubtful at this point because JMeter provides separate fields to be filled up and in one of the fields I might be passing incorrect value. 从IBM文档中我知道,当不存在任何一个存储过程时,就会发生此错误-情况并非如此,模式名称不正确-情况也并非如此,参数数量不匹配-我对此进行了验证,但对此表示怀疑这一点是因为JMeter提供了要填充的单独字段,并且在其中一个字段中我可能传递了错误的值。

I have not much knowledge of JMeter but with the help from apache JMeter documentation I have set below values to the Sample Fields. 我对JMeter的了解不多,但是在apache JMeter文档的帮助下,我为“样本字段”设置了以下值。

Query Type: Callable Statement 
Query: CALL DEVSCHEMA.GET_ROW_COUNT(?,?,?)
Parameter Values: ${__time(yyyy-MM-dd HH:mm:ss,)},${__time(yyyy-MM-dd HH:mm:ss,)},0 
Parameter Types: IN TIMESTAMP,IN TIMESTAMP,OUT INTEGER 
Variable Names:VARCOUNT 
Handle ResultSet: Store as a String

Can anyone please figure out where am I making a mistake? 有人可以找出我在哪里犯错吗? Many thanks. 非常感谢。

The issue has been resolved. 该问题已解决。 It was literally something else about which I never gave a thought. 从字面上看,我从未想过。 When I got the same error when I tried to access the same SP using Java code, I contacted DB2 team who wrote the Stored procedure. 当我尝试使用Java代码访问相同的SP时遇到相同的错误时,我联系了编写存储过程的DB2团队。 And issue was with the SP. 问题在于SP。 According to them execute access was given so after drilling here and there they preferred to create a new SP which worked without any issues. 据他们说, execute访问权限是给定的,因此在这里和那里进行钻探之后,他们倾向于创建一个新的SP,该SP可以正常工作。 Else everything was perfect from JMeter side. 在JMeter方面,其他一切都很完美。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM