-->
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: select 1 in NHibernate
PostPosted: Fri Feb 02, 2007 9:56 am 
Newbie

Joined: Wed Sep 27, 2006 7:40 am
Posts: 7
Hello!

How do I make "select 1 from dual" in NHibernate?

Best regards!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 02, 2007 11:00 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
You use ADO.NET...


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 02, 2007 11:11 am 
Contributor
Contributor

Joined: Sat Sep 24, 2005 11:25 am
Posts: 198
As far as I know, it is not possible.
What are you trying to do?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 06, 2007 12:11 pm 
Regular
Regular

Joined: Tue Mar 15, 2005 12:38 pm
Posts: 73
Location: Bucharest
Hello,

If this is what you really need (that is query dependent on oracle) than:

Code:
ISession session = null; // set to current session
IDbCommand cmd = session.SessionFactory.ConnectionProvider.Driver.CreateCommand();
cmd.CommandText = "select 1 from dual";
cmd.Connection = session.Connection;
cmd.Transaction.Enlist(currentDbCommand);
cmd.ExecuteScalar();


(Hope this still works with 1.2)

Dragos

_________________
Dragos


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.