0
votes

I am trying to pass a LocalDate value in the following native query from a TestController class -

@Query(nativeQuery = true, value = "SELECT SCHED_EVENT.UOID,SCHED_EVENT.A_OBJECT,SCHED_EVENT.A_OBJECT_ACTIVITY,SCHED_EVENT.A_EVENT_TYPE , " +
        " SCHED_EVENT.SCHEDULED_DATE,SCHED_EVENT.INVOICE_DUE_DATE,SCHED_EVENT.A_WORK_ITEM,SCHED_EVENT.A_OPER_BK_ORG , "+
        " INSTRUMENT.INSTRUMENT_ID,ACTIVITY.A_ACTIVITY_TYPE,ACTIVITY.SEQ_NUM_OF_ACTV_TY FROM SCHED_EVENT, INSTRUMENT, ACTIVITY "+
        " WHERE SCHED_EVENT.A_EVENT_TYPE = 'PAY' AND SCHED_EVENT.INVOICE_DUE_DATE = :invoiceDueDate "+
        " AND SCHED_EVENT.A_OBJECT = INSTRUMENT.UOID AND INSTRUMENT.UOID = ACTIVITY.P_INSTRUMENT AND SCHED_EVENT.A_OBJECT_ACTIVITY = ACTIVITY.UOID "+
        " AND EXISTS (SELECT SCHED_EVENT.A_OBJECT FROM INSTRUMENT, PARTY, CUSTOMER WHERE SCHED_EVENT.A_OBJECT = INSTRUMENT.UOID AND (INSTRUMENT.A_PRODUCT = 'ATP') "+
        " AND (INSTRUMENT.A_CLIENT_BANK = 'BMG' OR INSTRUMENT.A_CLIENT_BANK = 'CB1') AND (INSTRUMENT.A_TERMS_ACTIVE = PARTY.P_OBJECT) "+
        " AND (PARTY.RELATION_CUST_IND = 'Y') AND (PARTY.A_CUSTOMER = CUSTOMER.UOID) AND (CUSTOMER.CUSTOMER_ID = 'C119001' OR CUSTOMER.CUSTOMER_ID = 'C119003'))")
public List<Object[]> getATPPaymentScheduleList(@Param("invoiceDueDate") LocalDate invoiceDueDate);

I am passing the date from TestController class as -

@Autowired
private ScheduledEventRepository scheduledEventRepository;


@RequestMapping(method = RequestMethod.GET)
@Secure("bank setup")
@ResponseBody
public MappingJacksonValue findByActivityAndAmortAccrue(@RequestParam(value = "id", required = false) String id) {

    List<Object[]> entryList;
    org.joda.time.format.DateTimeFormatter fmt = DateTimeFormat.forPattern("dd-MMM-yy");
    LocalDate dateTime = new LocalDate();

    entryList = scheduledEventRepository.getATPPaymentScheduleList(dateTime.parse("11-APR-13", fmt));

    return buildResponseView(entryList, id);
}

}

When hitting the URL from PostMan, I am getting the following exception -

    exceptionMessage: 

"org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet", "stackTrace": "org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet\r\n\tat org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:261)\r\n\tat org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:244)\r\n\tat org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:488)\r\n\tat org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:59)\r\n\tat org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:213)\r\n\tat org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:147)\r\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)\r\n\tat org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodIntercceptor.invoke(CrudMethodMetadataPostProcessor.java:122)\r\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)\r\n\tat org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)\r\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)\r\n\tat org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)\r\n\tat com.sun.proxy.$Proxy490.getATPPaymentScheduleList(Unknown Source)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:497)\r\n\tat org.zeroturnaround.javarebel.integration.util.ReloadingProxyFactory$ReloadingMethodHandler.invoke(JRebel:74)\r\n\tat com.sun.proxy.$Proxy490.getATPPaymentScheduleList(Unknown Source)\r\n\tat com.cgi.t360.tps.controller.test.TestController2.findByActivityAndAmortAccrue(TestController2.java:251)\r\n\tat com.cgi.t360.tps.controller.test.TestController2$$FastClassByCGLIB$$ba1b29a4.invoke()\r\n\tat org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)\r\n\tat org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)\r\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)\r\n\tat org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85)\r\n\tat com.cgi.t360.tps.aspects.PerformanceAspect.profile(PerformanceAspect.java:66)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:497)\r\n\tat org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:629)\r\n\tat org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:618)\r\n\tat org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)\r\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)\r\n\tat org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:52)\r\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:168)\r\n\tat org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)\r\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)\r\n\tat org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)\r\n\tat com.cgi.t360.tps.controller.test.TestController2$$EnhancerBySpringCGLIB$$c3814053.findByActivityAndAmortAccrue()\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:497)\r\n\tat org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)\r\n\tat org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)\r\n\tat org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)\r\n\tat org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)\r\n\tat org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)\r\n\tat org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)\r\n\tat org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)\r\n\tat org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)\r\n\tat org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)\r\n\tat org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)\r\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:687)\r\n\tat org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)\r\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:790)\r\n\tat io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)\r\n\tat io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)\r\n\tat com.cgi.t360.tps.LogEnhancerFilter.doFilter(LogEnhancerFilter.java:25)\r\n\tat io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)\r\n\tat io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)\r\n\tat org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:178)\r\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\r\n\tat io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)\r\n\tat io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)\r\n\tat com.cgi.t360.tps.SimpleCORSFilter.doFilter(SimpleCORSFilter.java:42)\r\n\tat io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)\r\n\tat io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)\r\n\tat io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)\r\n\tat io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)\r\n\tat io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)\r\n\tat org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)\r\n\tat io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)\r\n\tat io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)\r\n\tat io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)\r\n\tat io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)\r\n\tat io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)\r\n\tat io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)\r\n\tat io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)\r\n\tat io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)\r\n\tat io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)\r\n\tat io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)\r\n\tat io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)\r\n\tat org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)\r\n\tat io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)\r\n\tat io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)\r\n\tat io.undertow.servlet.handlers.ServletInitialHandler.jrHandle(ServletInitialHandler.java)\r\n\tat org.zeroturnaround.javarebel.integration.servlet.undertow.cbp.ServletInitialHandlerCBP.handleRequest(ServletInitialHandlerCBP.java:98)\r\n\tat io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:285)\r\n\tat io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:264)\r\n\tat io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)\r\n\tat io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:175)\r\n\tat io.undertow.server.Connectors.executeRootHandler(Connectors.java:209)\r\n\tat io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:802)\r\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\r\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\r\n\tat java.lang.Thread.run(Thread.java:745)\r\nCaused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet\r\n\tat org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:63)\r\n\tat org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)\r\n\tat org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:109)\r\n\tat org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:95)\r\n\tat org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:79)\r\n\tat org.hibernate.loader.Loader.getResultSet(Loader.java:2117)\r\n\tat org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1900)\r\n\tat org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1876)\r\n\tat org.hibernate.loader.Loader.doQuery(Loader.java:919)\r\n\tat org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:336)\r\n\tat org.hibernate.loader.Loader.doList(Loader.java:2617)\r\n\tat org.hibernate.loader.Loader.doList(Loader.java:2600)\r\n\tat org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2429)\r\n\tat org.hibernate.loader.Loader.list(Loader.java:2424)\r\n\tat org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:336)\r\n\tat org.hibernate.internal.SessionImpl.listCustomQuery(SessionImpl.java:1967)\r\n\tat org.hibernate.internal.AbstractSessionImpl.list(AbstractSessionImpl.java:322)\r\n\tat org.hibernate.internal.SQLQueryImpl.list(SQLQueryImpl.java:125)\r\n\tat org.hibernate.jpa.internal.QueryImpl.list(QueryImpl.java:606)\r\n\tat org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:483)\r\n\tat org.springframework.data.jpa.repository.query.JpaQueryExecution$CollectionExecution.doExecute(JpaQueryExecution.java:110)\r\n\tat org.springframework.data.jpa.repository.query.JpaQueryExecution.execute(JpaQueryExecution.java:74)\r\n\tat org.springframework.data.jpa.repository.query.AbstractJpaQuery.doExecute(AbstractJpaQuery.java:99)\r\n\tat org.springframework.data.jpa.repository.query.AbstractJpaQuery.execute(AbstractJpaQuery.java:90)\r\n\tat org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:415)\r\n\tat org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:393)\r\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)\r\n\tat org.springframework.data.repository.core.support.RepositoryFactorySupport$DefaultMethodInvokingMethodInterceptor.invoke(RepositoryFactorySupport.java:506)\r\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)\r\n\tat org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)\r\n\tat org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)\r\n\tat org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)\r\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)\r\n\tat org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)\r\n\t... 92 more\r\nCaused by: java.sql.SQLSyntaxErrorException: ORA-00932: inconsistent datatypes: expected DATE got BINARY\n\r\n\tat oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:494)\r\n\tat oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:446)\r\n\tat oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1054)\r\n\tat oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:623)\r\n\tat oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:252)\r\n\tat oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:612)\r\n\tat oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:226)\r\n\tat oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:59)\r\n\tat oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:747)\r\n\tat oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:904)\r\n\tat oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1082)\r\n\tat oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3780)\r\n\tat oracle.jdbc.driver.T4CPreparedStatement.executeInternal(T4CPreparedStatement.java:1343)\r\n\tat oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3822)\r\n\tat oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1165)\r\n\tat org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:504)\r\n\tat org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:70)\r\n\t... 121 more\r\nCaused by: Error : 932, Position : 402, Sql = SELECT SCHED_EVENT.UOID,SCHED_EVENT.A_OBJECT,SCHED_EVENT.A_OBJECT_ACTIVITY,SCHED_EVENT.A_EVENT_TYPE , SCHED_EVENT.SCHEDULED_DATE,SCHED_EVENT.INVOICE_DUE_DATE,SCHED_EVENT.A_WORK_ITEM,SCHED_EVENT.A_OPER_BK_ORG , INSTRUMENT.INSTRUMENT_ID,ACTIVITY.A_ACTIVITY_TYPE,ACTIVITY.SEQ_NUM_OF_ACTV_TY FROM SCHED_EVENT, INSTRUMENT, ACTIVITY WHERE SCHED_EVENT.A_EVENT_TYPE = 'PAY' AND SCHED_EVENT.INVOICE_DUE_DATE = :1 AND SCHED_EVENT.A_OBJECT = INSTRUMENT.UOID AND INSTRUMENT.UOID = ACTIVITY.P_INSTRUMENT AND SCHED_EVENT.A_OBJECT_ACTIVITY = ACTIVITY.UOID AND EXISTS (SELECT SCHED_EVENT.A_OBJECT FROM INSTRUMENT, PARTY, CUSTOMER WHERE SCHED_EVENT.A_OBJECT = INSTRUMENT.UOID AND (INSTRUMENT.A_PRODUCT = 'ATP') AND (INSTRUMENT.A_CLIENT_BANK = 'BMG' OR INSTRUMENT.A_CLIENT_BANK = 'CB1') AND (INSTRUMENT.A_TERMS_ACTIVE = PARTY.P_OBJECT) AND (PARTY.RELATION_CUST_IND = 'Y') AND (PARTY.A_CUSTOMER = CUSTOMER.UOID) AND (CUSTOMER.CUSTOMER_ID = 'C119001' OR CUSTOMER.CUSTOMER_ID = 'C119003')), OriginalSql = SELECT SCHED_EVENT.UOID,SCHED_EVENT.A_OBJECT,SCHED_EVENT.A_OBJECT_ACTIVITY,SCHED_EVENT.A_EVENT_TYPE , SCHED_EVENT.SCHEDULED_DATE,SCHED_EVENT.INVOICE_DUE_DATE,SCHED_EVENT.A_WORK_ITEM,SCHED_EVENT.A_OPER_BK_ORG , INSTRUMENT.INSTRUMENT_ID,ACTIVITY.A_ACTIVITY_TYPE,ACTIVITY.SEQ_NUM_OF_ACTV_TY FROM SCHED_EVENT, INSTRUMENT, ACTIVITY WHERE SCHED_EVENT.A_EVENT_TYPE = 'PAY' AND SCHED_EVENT.INVOICE_DUE_DATE = ? AND SCHED_EVENT.A_OBJECT = INSTRUMENT.UOID AND INSTRUMENT.UOID = ACTIVITY.P_INSTRUMENT AND SCHED_EVENT.A_OBJECT_ACTIVITY = ACTIVITY.UOID AND EXISTS (SELECT SCHED_EVENT.A_OBJECT FROM INSTRUMENT, PARTY, CUSTOMER WHERE SCHED_EVENT.A_OBJECT = INSTRUMENT.UOID AND (INSTRUMENT.A_PRODUCT = 'ATP') AND (INSTRUMENT.A_CLIENT_BANK = 'BMG' OR INSTRUMENT.A_CLIENT_BANK = 'CB1') AND (INSTRUMENT.A_TERMS_ACTIVE = PARTY.P_OBJECT) AND (PARTY.RELATION_CUST_IND = 'Y') AND (PARTY.A_CUSTOMER = CUSTOMER.UOID) AND (CUSTOMER.CUSTOMER_ID = 'C119001' OR CUSTOMER.CUSTOMER_ID = 'C119003')), Error Msg = ORA-00932: inconsistent datatypes: expected DATE got BINARY\n\r\n\tat oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:498)\r\n\t... 137 more\r\n"

I have tried passing date in multiple formats but nothing worked. The data type of SCHED_EVENT.INVOICE_DUE_DATE in database is Date.

What is the correct way to pass the date here ?

1

1 Answers

0
votes

Error message is talling you that your sql request expecting to see Date as parameter but you put LocalDate instead, so to fix this you should convert your LocalDate value to Date.