jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deepak Shetty <>
Subject Re: using SQL select results as a Variable
Date Fri, 04 Mar 2011 17:52:19 GMT
You should specify variable names  on the JDBC request (Assuming that you
are getting these values as columns in a resultset).
Then you can put a debug sampler  after your JDBC request to see your
variables being populated .
To use these variables you typically could use a ForEach Controller (so if
you specified the variables names as Col1List,Col2List in JDBCRequest ,
inputVar will be Col1List  and returnVar can be say Col1)
Then your HTTP sampler will be a child of the ForEachController and in the
value ${Col1} --> i.e. the name you specified in returnVar.

You only need use regex if you are using Stored Procs with output variables
or if you only want one thing when you are actually returning lots of
data(why?). In this case also you just use ${variableName} in the value
field for the parameter in your http request. There are lots of examples of
using regex post processors in these mail archives

Note also if you have a web application the *ID* is usually present
somewhere in the HTML so you could always create a regex under the HTTP
Sample and extract the ID from there


On Fri, Mar 4, 2011 at 7:23 AM, Reg King <> wrote:

> Hi All,
> I am new to jmeter, and new to development so i am sorry if this is a
> simple
> question, i am unfortunatly finding it a little hard to sus out.
> I would like to use the results of a MySQL statement as a variable to later
> call in a HTTP post Request. The basic test is this: As part of the test
> plan i need to delete a record from the DB (via the HTTP Request), however
> the delete function uses the table ID as a hidden value. Each time a record
> is created the ID changes in the DB, so I cannot use a constant value and
> need to select the record ID value and use it as a variable for the HTTP
> Request to call.
> SQL = select ID from orderdetails where userno = 'AA044' and and accno =
> 99999999;
> I have set up a JDBC request to get this from the DB which is returning ‘ID
> XXXXXX’. This is where i am getting a little lost. I have set up a regex
> after this but am unable to sus out what the settings should be, or what
> else i need to do to.
> Would it be possible for someone to give me a really basic ABC step guide
> to
> how i can get this to work?
> Thank you very much for your time with this, after 3 hours of staring at
> jmeter im getting a little frazzled
> --
> View this message in context:
> Sent from the JMeter - User mailing list archive at
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message