Skip to content
Advertisement

Create and use database function with JPA

I want to create and immediatly use a database function in a single sql call.

As an example, the following works fine in PostgreSQL SQL Editor :

JavaScript

But when i try to use it with JPA :

JavaScript

I get the following error :

JavaScript

How could i make this work ?

Advertisement

Answer

You’re trying to execute two queries at once. You need to split this into two queries:

JavaScript
Advertisement