user8171831
user8171831

Reputation:

Jmeter Run SQL script from file

I am trying to run a couple SQL scripts in a Jmeter SetUp thread. Is it possible to run the SQL code from a .SQL file through Jmeter so I can initialize a database before my other threads get executed. I just don't want to break my code up and copy/paste code inside Jmeter using JDBC connection and JDBC request. Thanks!

Upvotes: 0

Views: 4961

Answers (1)

Dmitri T
Dmitri T

Reputation: 168092

__FileToString() function seems to be something you're looking for, you can put it inside your JDBC Request sampler and specify path to your .sql file there like:

JMeter JDBC From File

See Apache JMeter Functions - An Introduction to get familiarized with the JMeter Functions concept

Upvotes: 5

Related Questions