anu shaji
anu shaji

Reputation: 39

Not possible to pass jmeter variable to sql query in JDBC Request

In Jmeter, I have fetched data using 'CSV data set config. Now I got stuck how these data can be passed to Mysql database using JDBC request. I have added a query
'INSERT INTO rawdata_bk (data) VALUES ($data)'. But I am getting error like "Unknown column '$data' in 'field list'" So my question is how can i Pass the data from csv file to database row by row

Upvotes: 1

Views: 3961

Answers (1)

Dmitri T
Dmitri T

Reputation: 168072

JMeter Variables have slightly different syntax, you need to refer them as:

Full query will look like: INSERT INTO rawdata_bk (data) VALUES (${data})

If you will need to check ${data} variable value it can be done via Debug Sampler and View Results Tree Listener combination, see How to Debug your Apache JMeter Script article for details.

Upvotes: 1

Related Questions