user7982813
user7982813

Reputation: 151

Query using Order By in JDBC request

I have a jdbc request in jmeter where i am searching user data from the table.But data shows multiple records so i need to use order by latest updated date. enter image description here

SQL is working fine but display multiple record,how can i use

 SELECT CREATION_DATE,PROCESS_FLAG FROM 
 CUST  where ORDER_NUMBER =? order by 
 LAST_UPDATE_DATE desc;

because it is giving me error invalid character while trying using jmeter

Upvotes: 1

Views: 485

Answers (2)

Dmitri T
Dmitri T

Reputation: 168082

It is hard to guess what's wrong without seeing request and response details and knowing what database and which JDBC driver you're using.

Try the next tips:

  1. Check your ${OrderID} variable value using Debug Sampler
  2. Check generated query and parameter substitution using "Request" tab of the View Results Tree listener
  3. Check that you are using appropriate JDBC Driver for your database (not too old, not too new)
  4. Check if you can run the same query using plain Java code

Upvotes: 1

Ori Marko
Ori Marko

Reputation: 58772

JMeter doesn't allow to use ; sign at the end of JDBC Request select statement.

Do not enter a trailing semi-colon.

Just remove last character and SQL will be executed wìthout error.

Upvotes: 1

Related Questions