Oracle Analytics Cloud and Server

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

BI Publisher Data Model returns 'FAILED TO LOAD XML' error when using a parameter in a LIKE logic

Received Response
1
Views
1
Comments
3704406
3704406 Rank 2 - Community Beginner

I was trying to use a parameter (P_FIELD1) in my WHERE clause in a LIKE statement in a data model im working on and it wont work and would always return 'FAILED TO LOAD XML' error. I have tried making the parameter type as string too and still encounter the same error. Is my syntax incorrect or is there any other method/function i could use to achieve this? Refer to the statements below that i have tried and still encounter the same error. Thanks.

select * from MYTABLE WHERE FIELD1 LIKE ('%' + :P_FIELD1 + '%')

select * from MYTABLE WHERE TO_CHAR(FIELD1) LIKE ('%' + :P_FIELD1 + '%')

Answers

  • Thomas Dodds
    Thomas Dodds Rank 8 - Analytics Strategist

    You aren't using Oracle SQL Syntax ... || (dbl pipe) for concat:

    select * from MYTABLE WHERE FIELD1 LIKE ('%' || :P_FIELD1 || '%')

    select * from MYTABLE WHERE TO_CHAR(FIELD1) LIKE ('%' || :P_FIELD1 || '%')