JDBC Request is supporting only SQL queries and no .sql script files. It would be helpful to have a new Query Type: Script that would take a .sql script file path as input.
What format would the script file take? How is JMeter to know where the statement boundaries are? JDBC does not support multiple queries per statement, as far as I know. A lot of databases support script files, but as far as I know there is no standard for statement delimiters or indeed for SQL features such as commit, rollback, and set statements.
Created attachment 23514 [details] JDBCSampler with Script Query Type I'm using the attached JDBC Sample code that allows Script as Query Type. The for the Query is the script file that was previously created as a DB dump. The only limitation that I have to cope with in my case is the 'client_encoding' that can be set only to 'UNICODE' or not specified at all.
The script file appears to use -- as a comment marker, and ; at the end of a line to delimit statements. As far as I know, neither of these are standardadised. Also, using ";" to delimit statements is unlikely to work in all cases. So whilst it might work for your particular case, it looks like it will not work for all JBDC implementations. It's important that JMeter is able to work with all JDBC implementations.
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2225