-->
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.  [ 9 posts ] 
Author Message
 Post subject: Trying to use Informix : (colon) notation in native SQL
PostPosted: Fri Dec 02, 2005 8:32 am 
Newbie

Joined: Fri Dec 02, 2005 8:20 am
Posts: 4
Hi I'm building a system with hibernate and an existing database in Informix. Informix sql syntax supports the notation <database>:<table-name> for selecting from tables in another database than the one currently connected to. Since hibernate uses the : character to prefix named parameters the colon doesn't get passed to the database. Any ideas how to solve this ? I'm new to hibernate but I guess there must be a way of escaping the colon to indicate to hibernate that it should remain in the query ?

Thankfull for any help on this

Regards
Steinar Dahl


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 02, 2005 11:41 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Nope, the colon is non-escapable


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 02, 2005 11:47 am 
Regular
Regular

Joined: Tue Oct 28, 2003 8:25 am
Posts: 72
Location: Belgium
Can't that be considered a bug or a missing feature ? It should not be that hard to add logic to the interpreter to understand an escape character, should it ?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 02, 2005 11:54 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
the problem with issues like this is always "ok, then what is the escape character?". It's harder to do then to say ;)

Besides any real database that allows this behavior also allows local namespacing of the linked-to database (database-links in Oracle, linked-servers in SQLServer/Sybase).


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 02, 2005 12:01 pm 
Regular
Regular

Joined: Tue Oct 28, 2003 8:25 am
Posts: 72
Location: Belgium
Personally I would escape it with itself for that particular case only.

On the other hand, you're most probably right about DB namespacing features. I was just asking for the sake of completeness. :-)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 05, 2005 7:36 am 
Newbie

Joined: Fri Dec 02, 2005 8:20 am
Posts: 4
Thanks for the information. Will probably put the query in a database view to work around this issue.

Maybe there should be a section in the manual describing what the limitations are with native sql ?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 05, 2005 9:12 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
patches are welcome.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 06, 2005 8:34 am 
Newbie

Joined: Fri Dec 02, 2005 8:20 am
Posts: 4
ok, I've got a patch. We're do I submit it ?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 06, 2005 6:49 pm 
Regular
Regular

Joined: Tue Oct 28, 2003 8:25 am
Posts: 72
Location: Belgium
A new JIRA bug is the best place I would say. Just attach your patch to the bug.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.