Native Oracle Query and Hibernate Error

P

puneet.bansal

Has anybody run into an issue with Hibernate/JPA where an Oracle query
runs fine on SQL Plus but gives an error 'ORA-00900: invalid SQL
statement' when the same query is executed as a native query through
Hibernate/JPA? I can't figure out why the query would run on Oracle
client but fail when Hibernate tries to execute it.

Any ideas?

Thanks.
Puneet
 
P

puneet.bansal

Has anybody run into an issue with Hibernate/JPA where an Oracle query
runs fine on SQL Plus but gives an error 'ORA-00900: invalid SQL
statement' when the same query is executed as a native query through
Hibernate/JPA? I can't figure out why the query would run on Oracle
client but fail when Hibernate tries to execute it.

Any ideas?

Thanks.
Puneet

Alright, it was a silly mistake. I was using 'createNativeQuery'
instead of 'createNamedQuery'.

Puneet
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,783
Latest member
RickeyDort

Latest Threads

Top