-->
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.  [ 3 posts ] 
Author Message
 Post subject: How to get SQL stat while net.sf.hibernate.JDBCException?
PostPosted: Wed Feb 16, 2005 8:23 pm 
Newbie

Joined: Fri Aug 27, 2004 10:36 am
Posts: 8
I got the following error when I tried to save new object into Oracle 9i DB.
(see below)

The question is: How to get the detailed SQL statements generated by Hibernate(in my case, it will be several INSERT statements) so I can see what's wrong? (I set show_sql=true)

Hibernate version: 2.1.7

Full stack trace of any exception that occurs:
2005-02-16 17:18:02,734 WARN [main] util.JDBCExceptionReporter (JDBCExceptionReporter.java:38) - SQL Error: 936, SQLState: 42000

2005-02-16 17:18:02,734 ERROR [main] util.JDBCExceptionReporter (JDBCExceptionReporter.java:46) - ORA-00936: missing expression


2005-02-16 17:18:02,734 WARN [main] util.JDBCExceptionReporter (JDBCExceptionReporter.java:38) - SQL Error: 936, SQLState: 42000

2005-02-16 17:18:02,734 ERROR [main] util.JDBCExceptionReporter (JDBCExceptionReporter.java:46) - ORA-00936: missing expression


2005-02-16 17:18:02,750 ERROR [main] util.JDBCExceptionReporter (JDBCException.java:38) - Could not save object

java.sql.SQLException: ORA-00936: missing expression


at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)

at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAccess.java:2337


Name and version of the database you are using: Oracle 9i

The generated SQL (show_sql=true):I set it true, but no SQL statement


Top
 Profile  
 
 Post subject: Any idea how to print SQL generated?
PostPosted: Thu Feb 17, 2005 3:05 pm 
Newbie

Joined: Fri Aug 27, 2004 10:36 am
Posts: 8
(I set show_sql=true) when I saved a parent Object (has many children objects) into Oracle 9i DB, it gave ORA--00936: missing expression error.
I like to know what SQL generated(several INSERT statements) so I can debug the issue.

Thanks in advance.


Top
 Profile  
 
 Post subject: Any helps?
PostPosted: Thu Feb 17, 2005 3:47 pm 
Newbie

Joined: Fri Aug 27, 2004 10:36 am
Posts: 8
When I load the parent object with primary key value(Hibernate loads all children objects), it works fine, I can print out child object values--that means the mapping is correct.

But when I construct parent object and child objects, then try to save them into Oracle 9iDB, I got ORA-00936: missing expression error. Even I just construct parent object with primary key only--the parent table underlined just requires primamy key(leave all child objects null), I still got the same error message. Any ideas? I like to see if SQL generated is completed, but how do I print it out?(I set show_sql=true).


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.