1
votes

Can JMeter JDBC pre-processor accept multiple Insert/delete/update queries?

I have added two queries:

1

2

2 Answers

1
votes

JMeter can do whatever underlying JDBC driver can do, for example for MySQL you can specify allowMultiQueries JDBC URL parameter and you will be able to separate statements by semicolon.

Looking into oracle pool variable name my expectation is that you're trying to test an Oracle database and its JDBC driver doesn't support this feature.

The options are in:

  1. Create a stored procedure which will delete multiple records
  2. Parameterize existing JDBC PreProcessor using i.e. __StringFromFile() function, in this case you will not have to copy and paste the preprocessors
  3. Use JSR223 PreProcessor instead of the JDBC PreProcessor and implement your records deletion logic there, take a look at Statement.addBatch() function, you can combine multiple queries into one statement with it. Check out Using Statement Objects for Batch Updates chapter of the Retrieving and Modifying Values from Result Sets article for more details.
0
votes

You can submit multiple queries as is, because you can't use ; in JDBC request

But you can use other techniques to insert/delete multiple records, for example using IN

delete from CPAY where bnf_nic_name in ('BillerBBJ929' ,'BillerOFV864')