|
This sample works but i have a problem with the following query: "select c.ID , p.result as price from contracts as c left join MyStoredProcedure(c.ID) p on 1=1 where c.ID = ?" (the ? are field in)
On context initialization the function is going right but when I run a test i get the following error.
The error is: org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [select c.ID , p.result as price from contracts as c left join MyStoredProcedure(c.ID) p on 1=1 where c.ID= ?]; nested exception is org.h2.jdbc.JdbcSQLException: Column "C.ID" not found; SQL statement: select c.ID , p.result as price from contracts as c left join MyStoredProcedure(c.ID) p on 1=1 where c.ID= ? [42122-187] at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:231)
I'm using Spring, embedded h2 database. Does someone know how to fix this problem?
|