0

So I am trying to update my database using the data extracted from the HTTP request samplers. So I have the following sql query which works fine for one record:

UPDATE optim_user
SET equip_uptime = CONCAT('${timestamp_rg1}', ',', '${timestamp_ext1}'), equip_fw = CONCAT('${firmware_rg1}',',', '${firmware_ext1}')
WHERE optim_uid = '${serialnumber_soak1}';

I want to update 50 or so records with the data extracted from my hTTP requests. I have tried following the steps mentioned here but It did not work. Below are the screen shots of the CSV data config and the JDBC samplerenter image description hereenter image description here

Is there a way to include multiple sql statements? Thanks.

Abhishek
  • 80
  • 1
  • 9

2 Answers2

0

You can use case for multiple updates.in your case add multiple conditions as:

 UPDATE optim_user
 SET equip_uptime = case   optim_uid 
 WHEN   '${serialnumber_soak1}'  THEN 
 CONCAT('${timestamp_rg1}', ',', '${timestamp_ext1}')
 End

  .....
Ori Marko
  • 56,308
  • 23
  • 131
  • 233
0

The correct syntax of referencing a JMeter Variable would be either ${statement} or ${__V(statement)}.

Also if your CSV file contains references to other JMeter functions and/or variables you will additionally need to wrap it into __eval() function so my expectation is that you need to come up with something like:

${__eval(${statement})}

See Here’s What to Do to Combine Multiple JMeter Variables article for more details.

Dmitri T
  • 159,985
  • 5
  • 83
  • 133