0

I'm trying to call a user defined function from PLSQL database, it takes several variables and return a single float.

I've tried code like this:

@Query(nativeQuery = true, value = "SELECT package.function("variables: 
value")
float getFuction(@Param("value") String value);

This shows an error saying "FROM keyword was not found where expected.

2
  • 2
    Maybe you need add ` from dual` Check this stackoverflow.com/questions/45867348/… Commented Oct 31, 2019 at 12:29
  • yeah it works now, but why does it work? Commented Oct 31, 2019 at 12:32

2 Answers 2

3

I think that it should be like that (i do not have chance to check):

@Query(nativeQuery = true, value = "SELECT package.function(:value) FROM dual")
float getFuction(@Param("value") String value);

It is based on this answer

Sign up to request clarification or add additional context in comments.

Comments

0

The solution:

@Query(nativeQuery = true, value = "SELECT package.function("variables: value") FROM dual")
float getFuction(@Param("value") String value);

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.