Hi,
I am trying to execute a native sql query from spring hibernate application which looks like:
String query = “Select i.providercd as alternatives from doc.insurers i where ANY(i.products[‘name’]) = :productcd”;
Object obj = em.createNativeQuery(query).setParameter(“productcd”, productcd).getResultList();
But it fails at execution time with the error below:
2019-04-23 16:18:20.192 ERROR 18816 — [nio-8080-exec-1] o.h.engine.jdbc.spi.SqlExceptionHelper : ERROR: SQLParseException: line 1:63: no viable alternative at input ‘Select i.providercd as alternatives from doc.insurers i where ANY’
2019-04-23 16:18:20.206 ERROR 18816 — [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not extract ResultSet] with root cause
io.crate.shade.org.postgresql.util.PSQLException: ERROR: SQLParseException: line 1:63: no viable alternative at input ‘Select i.providercd as alternatives from doc.insurers i where ANY’