Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Query throwing “Invalid column name” error.

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have one small issue on the SQL query..
I am trying to execute the following query , but its throwing error saying “Invalid column name”.
QUERY:
SELECT extractValue(aei.EVENT_DETAIL_XML,'/RMEvent/PricingCustomerID') as CustId, count(*) from APPLICATION_EVENT_INSTANCE aei
WHERE aei.ACTION_NAME =’CUSTOMER_LOGIN’
AND extractValue(aei.EVENT_DETAIL_XML,'/RMEvent/PricingCustomerID') is not null
AND aei.EVENT_TMSTMP BETWEEN to_date(‘3/1/2009’,'mm/dd/yyyy')
AND to_date(‘5/15/2009’,'mm/dd/yyyy')
GROUP BY extractValue(aei.EVENT_DETAIL_XML,'/RMEvent/PricingCustomerID')

The same query works well in the TOAD but when I run in eclipse its shows the following error:
ERROR:
Hibernate: SELECT extractValue(aei.EVENT_DETAIL_XML,'/RMEvent/PricingCustomerID') as CustId, count(*) from APPLICATION_EVENT_INSTANCE aei
WHERE aei.ACTION_NAME =?
AND extractValue(aei.EVENT_DETAIL_XML,'/RMEvent/PricingCustomerID') is not null
AND aei.EVENT_TMSTMP BETWEEN to_date(?,'mm/dd/yyyy')
AND to_date(?,'mm/dd/yyyy')
GROUP BY extractValue(aei.EVENT_DETAIL_XML,'/RMEvent/PricingCustomerID')
0 [main] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 17006, SQLState: null
0 [main] ERROR org.hibernate.util.JDBCExceptionReporter - Invalid column name
0 [main] FATAL com.gfs.ebiz.rm.usage.RMUsageAggregation - Exception occured while running UsageAggreagation Process

I am using hibernate to execute queries & this query is in one of the .hbm file, What I guess is its not identifying the “extractValue(aei.EVENT_DETAIL_XML,'/RMEvent/PricingCustomerID')” as a query column, could you please help on this? Earlier help is deeply appreciated.
 
Farmers know to never drive a tractor near a honey locust tree. But a tiny ad is okay:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic