Forum Discussion

N78A's avatar
N78A
Contributor
7 years ago

SoapUi JDBC request - Problem in running query.

Hi,

 

I am trying to run a query in JDBC request but its not fetching me the result from oracle database. Query is :

 

select  substr(transaction_date_key,1,6), sum(transaction_value), sum(total_discount) from f_customer_trans_new where
d_customer_key = (select d_customer_key from <table>where cust_number =:customerId)
and substr(transaction_date_key,1,6) >= substr(TRUNC(ADD_MONTHS(TRUNC(ADD_MONTHS(SYSDATE(), -3),'MM'),-12),'MM'),1,7)
and substr(transaction_date_key,1,6) <= substr(TRUNC(ADD_MONTHS(SYSDATE(),-3),'MM'),1,7)
GROUP BY substr(transaction_date_key,1,6)

 

but same qery runs correctly in SQL client

 

Below query gives me correct result.

 

select  substr(transaction_date_key,1,6), sum(transaction_value), sum(total_discount) from f_customer_trans_new where
d_customer_key = (select d_customer_key from <table> where cust_number =:customerId)
GROUP BY substr(transaction_date_key,1,6)

 

I am not able to understand where is the problem , is it because of the functions - TRUNC, SYSDATE, ADD_MONTHS ?

 

 

 

2 Replies

  • Can you share the error that you are getting? Also do you have a oracle driver in your bin folder? If not, copy one and put it there. That should solve the issue if it is because of missing driver. If its something else, sharing error code should be able to help. 

    Success!

    Pramod 

    • N78A's avatar
      N78A
      Contributor

      Hi,

       

      Sorry I missed the track due to some reasons, my problem is resolved now.

      Thanks for your message.