Running Stored Procedure From JMeter

2019-09-18 18:07发布

问题:

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