Running Stored Procedure From JMeter

大兔子大兔子 提交于 2019-12-12 03:33:15

问题


I have a stored procedure as below which I run to create some test data automatically using PL/SQL Developer. It just runs fine.

begin
  create_test_data('000000316F1422C8','N',1,'2016-01-26');
end;
/

I was automating some project in JMETER and there as part of setup I need to create this data. I tried to connect to Oracle DB using JDBC Request Sampler can fire Select Queries which are working fine.

Now I want to run this Stored Procedure to Generate the data from JMETER: I tried to use JDBC Request sampler and copied the above code but it doesn't work.

Can somebody please help?

  1. Is JDBC Request Sampler Correct way to run this Stored procedure
  2. While I am running it from JDBC Request Sampler I am getting below Errors:

a. Error 1

ORA-06550: line 4, column 1:
PLS-00103: Encountered the symbol "/" The symbol "/" was ignored.

b. Error 2 If I remove slash from the last line

ORA-06550: line 2, column 3:
PLS-00201: identifier 'CREATE_NEXNET_TEST_DATA' must be declared
ORA-06550: line 2, column 3:
PL/SQL: Statement ignored
  1. How can we verify in the end if stored procedure can run successfully

Many Thanks!!


回答1:


Yes, JMeter is capable of invoking stored procedures, Use Callable Statement as "Query Type" and provide relevant Parameter values and types.

References:

  • https://bz.apache.org/bugzilla/show_bug.cgi?id=54048
  • Debugging JDBC Sampler Results in JMeter



回答2:


Here this worked fine to me (without "{", "}", "begin", "end"):

Using query type: Callable Statement

CALL SCHEMA_NAME.PKG_NAME.PROCEDURE_NAME
     (
          PARAM_1 => 'TESTING',
          PARAM_2 => 0000,
          ...
      )


来源:https://stackoverflow.com/questions/35066074/running-stored-procedure-from-jmeter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!