mafodope
mafodope

Reputation: 107

JMeter - Using the result of OracleSQL procedure in another request

I have a Thread Group that looks something like this:

JDBC Connection
Request_1
Request_2

Request_1 is an OracleSQL procedure that returns a number.

declare
result NUMERIC;
begin
    result:=procedure1();
end;

Request_2 needs the number returned by Request_1.

begin
    procedure(?);
end;
result
NUMERIC

How do I pass the result of Request_1 to Request_2?

Upvotes: 0

Views: 80

Answers (1)

user2862211
user2862211

Reputation:

I guess that you need to add Regular Expression Extractor post-processor to your Request 1.

If result value is a number, i.e. "10" you can do the following to extract it.

  • Add "Regular Expression Extractor" Post Processor to request 1
  • Fill "Regular Expression Extractor" fields as follows:
    • Reference Name: RESULT
    • Regular Expression: (\d+)
    • Template: $1$

You can refer RESULT variable in your Request2 as ${RESULT}

begin
procedure(${RESULT});
end;
result
NUMERIC

You can test your regular expression using Jakarta ORO Demonstration applet

Upvotes: 1

Related Questions