当前位置: 首页 > 知识库问答 >
问题:

错误消息=ORA-00932:不一致的数据类型:预期的日期得到二进制

微生慈
2023-03-14

我正试图在以下来自TestController类的本机查询中传递LocalDate值-

@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);

我正在将来自TestController类的日期传递为-

@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);
}

当点击邮递员的URL时,我得到了以下异常-

    exceptionMessage: 

我尝试过以多种格式传递日期,但没有任何效果。数据库中SCHED_EVENT.INVOICE_DUE_DATE的数据类型是DATE。

这里的日期正确的传递方式是什么?

共有1个答案

屠锐
2023-03-14

错误消息告诉您,您的sql请求希望看到date作为参数,但您将localdate作为替代,因此,要解决此问题,您应该将localdate值转换为date

 类似资料: