I have the following situation:
I want to run scripts in Oracle, using JDBC Request in Jmeter.
The connection configuration is now ok.
When I run the script, I get an error. And a detail: The same script within PL/SQL is successfully executed.
Error: "java.sql.SQLSyntaxErrorException: ORA-00911: invalid character".
Does anyone know why?
Script:
SELECT *FROM TBJDALRT_ALERTA_TP;
Prints below (script and error).
enter image description here
enter image description here
Thank you!
Remove ; from your statement. Executing several SQL statements in one JDBC Request sampler is not supported, you either need to switch to JSR223 Sampler and Groovy language and invoke Statement.executeBatch() function or go for 2 separate JDBC Request samplers.
More information: Apache Groovy - Working with a relational database
Related
In my PL/SQL script, I have requirement to test the connectivity of remote data. Normally, in OS shell, we use command tnsping. Is there any command in SQL or PL/SQL so that I can test connectivity.
Basically, I am getting some data using database link. I want my script to execute immediately. If remote database is available then I want to run query using database link. If remote database is unavailable then I want to skip the getting of data using database link. So, this is the reason why I am looking for.
Kindly guide me for proper way. So, that my script does not hang in case of unavailability of remote database.
I am using Oracle 12.1C.
I am using Jmeter 5 to run a simple SQL UPDTAE statement using JDBC Request sampler. After running the query ([Screenshot: JDBC Request][2])I can see in the result tree window it says "1 updates" ([Screenshot: View Result Tree][1]), but when I check within the database I dont see the specific field is getting updated.
It doesn't seem to be a connection issue. When I run the same query from Management Studio the field is getting updated fine. Am I missing some settings in Jmeter?
You need to set true in Auto Commit of JDBC Connection Configuration
Turn auto commit on or off for the connections.
For one of the test plan, I have 1000's of records. It would be helpful to have bulk update. Has anyone implemented it or know of how to implement it in Jmeter. Also, can prepared update statement be used to achieve it?
You just need to follow the given below steps to create a JDBC test plan.
1) Firstly, Download the JDBC Driver for SQL Server from Microsoft site.
2) Once the JDBC Driver is downloaded extract to find the .jar file of driver.
3) Now, open the Jmeter and create a test plan.
4) Select the test plan node and there is a section "Add directory or jar to classpath", browse the extracted JDBC Driver and select it.
5) Create a thread group and add config element "JDBC Connection Configuration" and configure according to your requirement.
6) Make sure to provide the variable name.
7) Now, Add a JDBC Request from the samplers in thread group section and use the same variable as you mentioned in the "JDBC Connection Configuration".
8) Select the query type as "Update Statement" from the drop down.
9) Mention your query in the editor panel.
10) Finally, add the listener to trace the output of your test plan and execute the test.
Hope this will entertain your question.
I am beginner to liquibase usage and also to deployIT.
My question is when we run sql statements in sql developer editor we get output like anonymous block completed and also we see output of statements dbms_output.put_line....
If we run same scripts from liquibase,deployIt it does not show whatever shown in sqldeveloper editor like anonymous block completed etc
can any one please suggest what all can be done ?
I have a requirement where I need to run a sql script containing multiple select statement and then to store in a xml file using pentaho. I need to do this using command line as a cron job will initiate the execution of sql script. I tried using execute sql script but no success. Can any one please suggest me how to do it using pentaho or any other better etl tool which is open source. Thanks