2

I have an Oracle Editionalble Function (that I cannot change) which I need to call from Hibernate.

CREATE OR REPLACE EDITIONABLE FUNCTION
"SCHEMA"."FUNCTION_NAME"
(
  var1 IN CHAR DEFAULT NULL ,
  var2 IN CHAR DEFAULT NULL ,
  var3 OUT CHAR
)
RETURN NUMBER
AS
  ...
END;

Unfortunately, I have no idea how to do this. I saw a couple of posts on here about Session.doWork(), but I couldn't figure out how to make that work here.

2 Answers 2

1

As long as the function does not change data you can use the dual table to call it from a query.

select schema.function_name(:bind1,:bind2,:bind3) from dual;
Sign up to request clarification or add additional context in comments.

Comments

1

You can try something like:

Query query = session.createSQLQuery(
    "CALL myfunc(:param1)")
    .setParameter("param1", "xyz");

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.