Skip to content

ORA-01425: escape character must be character string of length 1 #3753

@gowrishankarjhcbb

Description

@gowrishankarjhcbb

Query Generated by spring data jpa is invalid and having double slash for oracle.

This is my code snippet

Optional<EdpRecordData> findByMsgIdAndCreditorAgentStartsWithAndDebtorAgentStartsWith(
      String msgId,
      String creditorAgent,
      String debtorAgent);

SQL Query Generated

    select
        erd1_0.msg_id,
        erd1_0.debtor_agent,
        erd1_0.creditor_agent 
    from
        edp_records erd1_0 
    where
        erd1_0.edp_status=? 
        and erd1_0.creditor_auto_presentment_flag=1 
        and erd1_0.creditor_auto_presentment_date=? 
        and erd1_0.creditor_agent like ? escape '\\'
Hibernate: 
    select
        erd1_0.msg_id,
        erd1_0.debtor_agent,
        erd1_0.creditor_agent 
    from
        edp_records erd1_0 
    where
        erd1_0.edp_status=? 
        and erd1_0.creditor_auto_presentment_flag=1 
        and erd1_0.creditor_auto_presentment_date=? 
        and erd1_0.creditor_agent like ? escape '\\'

Exception thrown by Oracle.
java.sql.SQLDataException: ORA-01425: escape character must be character string of length 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: external-projectFor an external project and not something we can fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions