6

I am trying to drop the temp table using hibernate native SQL (createSQLQuery) statement. Here is code:

session.createSQLQuery("DROP TABLE tmp_dummy_table").executeUpdate(); 

However It throws me below exception:

SQL Error: 1003, SQLState: 24000 ORA-01003: no statement parsed Exception while creating tmp_dummy_table tableorg.hibernate.exception.GenericJDBCException: org.hibernate.exception.GenericJDBCException:could not execute query at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.loader.Loader.doList(Loader.java:2223) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104) at org.hibernate.loader.Loader.list(Loader.java:2099) at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:289) at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1695) at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142) at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:152) .... 

Could you please suggest whats wrong in this code?

1 Answer 1

4

From your stacktrace it looks like you called list() instead of executeUpdate(), as you write in the code sample. Make sure you actually call executeUpdate().

Sign up to request clarification or add additional context in comments.

1 Comment

yeh, I found that solution and issue fixed after implimenting executeUpdate(). Thanks for suggession.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.