-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Works in MySQL, but not in Oracle
PostPosted: Mon Jul 30, 2012 2:01 pm 
Newbie

Joined: Mon Jul 30, 2012 1:49 pm
Posts: 2
I set "show SQL" to true and this is (well, with the variable names and db obfuscated) the insert I'm trying to do:

Hibernate: insert into <our database> (VAR1, VAR2, VAR3, VAR4, VAR5, VAR6, VAR7, VAR8, VAR9, VAR10, VAR11, VAR12, VAR13, VAR14, VAR15, VAR16, VAR17, VAR18) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) Jul 30, 2012 10:20:21 AM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
WARN: SQL Error: 926, SQLState: 42000
Jul 30, 2012 10:20:21 AM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
ERROR: ORA-00926: missing VALUES keyword

But, in MySQL, the insert works, and the dependent test call to update succeeds...

Hibernate: insert into <our database> (VAR1, VAR2, VAR3, VAR4, VAR5, VAR6, VAR7, VAR8, VAR9, VAR10, VAR11, VAR12, VAR13, VAR14, VAR15, VAR16, VAR17, VAR18) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Hibernate: select ...
Read succeeded for <id>
Hibernate: select ...
Hibernate: update ...
Update succeeded for <id>

But Oracle bails on the insert. I originally used the plain Oracle Dialect, and saw that it was deprecated in 4.1.4 (which I am using). In the off chance that could be the problem, I changed it to org.hibernate.dialect.Oracle10gDialect -- no difference.

What would make Oracle think that Hibernate didn't send the values keyword, since Hibernate appears to have used it???

Thanks!!

Maffy


Top
 Profile  
 
 Post subject: Re: Works in MySQL, but not in Oracle
PostPosted: Mon Jul 30, 2012 2:36 pm 
Newbie

Joined: Mon Jul 30, 2012 1:49 pm
Posts: 2
Found the problem.
One of my variables was a keyword. Doh! So the interpretation of the VALUES keyword was lost.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.