How do I get the NextVal from an oracle Sequence thru NHibernate

Posted by trainer on Stack Overflow See other posts from Stack Overflow or by trainer
Published on 2011-01-07T18:41:29Z Indexed on 2011/01/07 18:54 UTC
Read the original article Hit count: 171

Filed under:
|
|
|
|

I am working on c# .net 4.0 and using NHibernate to talk with an Oracle DB. You would think something as simple as this is already addressed somewhere but sadly its not. I need the NextVal from an Oracle sequence. I do not need to insert it a database as part of an Id or Primary key. I just need to use the next val on the c# side.

Can somebody help me out with xml mapping and C# file(or a link) to achieve this.

Thanks.

Something like

int NextValueOfSequence = GetNextValueofSequence();

public int GetNextValueOfSequence()
{

// Access NHibernate to return the next value of the sequence.

}

© Stack Overflow or respective owner

Related posts about Oracle

Related posts about nhibernate