• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Ibatis Query Returns null

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I am struck with a strange problem in my application since morning. When i try to run the following query using ibatis in my application



to get the total count of a database column ,the query returns null. When i remove the filters on product and customer in the query the query runs perfectly and returns the count. Its only when the filters for product or customer is present query returns a null. Below is the query generated by ibatis for the above sql map with only product filter.

SELECT SUM(message_count) AS trans_count FROM oms_product_summary
WHERE created_dt BETWEEN to_date(?,'mm/dd/yyyy') AND to_date(?,'mm/dd/yyyy')
[java.sql.PreparedStatement] - {pstm-100028} Parameters: [10/01/2011, 10/11/2011, LIDB]
[java.sql.PreparedStatement] - {pstm-100028} Types: [java.lang.String, java.lang.String, java.lang.String]

When i run the above query from SQLdeveloper it works perfectly!. Could any one with expertise on Ibatis point me what am i doing wrong here.

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic