How to access Oracle stored procedure using NHibernate software?

(Apologize in advance if the question seems to be repeated. But, as far as I looked at other questions on SF, they did not answer this question. And I'm new to NH, so thanks for putting up my noob skills.)

How to access Oracle stored procedure with NHibernate software?

Suppose we have a stored procedure in Oracle db. How can I call it (even with my own built-in NHibernate function)?

+3
source share
1 answer

Use the method ISession.CreateSQLQuery.

var query = session.CreateSQLQuery("EXEC myStoredProc :p1, :p2");
query.SetParameter("p1", "someValue");
query.SetParameter("p2", 5);

Use List, UniqueResultor ExecuteUpdateto start a saved process.

+4
source

Source: https://habr.com/ru/post/1790685/


All Articles