-->
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.  [ 4 posts ] 
Author Message
 Post subject: Bad Sql error while running an oracle sql statement
PostPosted: Sat Feb 06, 2010 12:22 pm 
Newbie

Joined: Sat Feb 06, 2010 11:54 am
Posts: 4
Hi All,

Im new to NHibernate. I am getting an bad sql error while executing the HQL. This is due to the select query generated from the HQL does not include double quotes for the table name.Basically my oracle database tables are created using double quotes.
Ex: Create Table "Customer"
So to retrieve the data we need to write the select query as follows.
Select * from "Customer";
But the generated HQL does not include double quotes to the table.
How can i achieve this HQL?Are there any properties that i need to set in mapping files?

Please help me in this.

Thanks,
Sai


Top
 Profile  
 
 Post subject: Re: Bad Sql error while running an oracle sql statement
PostPosted: Mon Feb 08, 2010 3:57 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Hi,

are the double quotes really part of your table names?
(Is the length of your "Customer" table-name really 10, or is it 8?)

If yes, then that is definitely not standard usage of Oracle,
and you definitely avoid table names including double quotes,
because this most probably don't creates only problems to hibernate...


Top
 Profile  
 
 Post subject: Re: Bad Sql error while running an oracle sql statement
PostPosted: Mon Feb 08, 2010 1:39 pm 
Newbie

Joined: Sat Feb 06, 2010 11:54 am
Posts: 4
Yes the double quotes are part of table name. Is there any way where i can handle these quotes in NHibernate.

Regards,
Sai


Top
 Profile  
 
 Post subject: Re: Bad Sql error while running an oracle sql statement
PostPosted: Wed Feb 10, 2010 3:16 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Get rid of the double quotes being part of the table name!
You will not only have problems with hibernate, also with other tools such as sql-tools you will run into troubles.
Use standard naming conventions for table-names.(Standard naming don't includes double quotes as suitable character.)


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