-->
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: CreateSQLQuery - fully qualified tablenames
PostPosted: Sun Aug 12, 2007 7:54 pm 
Newbie

Joined: Sun Aug 12, 2007 7:43 pm
Posts: 3
Location: Göteborg, Sweden
I'm using NHibernate 1.2.0 together with SQL Server 2005 Express, and it seems I have to specify fully qualified tablenames, like this:

"databasename.dbo.tablename"

when I create a query via the ISession.CreateSQLQuery() method. I only return scalar values (this is a reporting query), and the query works just fine when I specify full tablenames, but it is suboptimal as it makes the SQL depend upon a static databasename. Is there a way to correct this?

BTW: I do have the default_schema property setup correctly in the applications config.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 13, 2007 2:15 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
What is the error message if you don't specify fully qualified names?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 13, 2007 4:25 am 
Newbie

Joined: Sun Aug 12, 2007 7:43 pm
Posts: 3
Location: Göteborg, Sweden
An unhandled exception of type 'NHibernate.ADOException' occurred in Dinumero.Data.dll

Additional information: could not execute query

The internal exception message I get is this: {"Ogiltigt objektnamn, 'XXX'."}

The error message is localized to Swedish, but it translates into "Invalid object name" where XXX is the tables name.
[/quote]


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.