Single quotes Escape from parameter values

Defined one parameter called "display_name" in sql editor and passing dynamic values in to it and capture in the where ( org_name in ('x','y','I'am there') ) clause as per below .however few values are already have single quotes in it (ex : I'am there) and throwing an error . any help? how to escape single quotes ?

select distinct ltrim(rtrim( as email from table_name a
and ltrim(rtrim(b.display_name)) in ({{display_name}})


{% form %}

    type: multiselect
    default: all
        labels: email
        values: email

{% endform %}

1reply Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Hi hari babu ,

    Sorry for the delayed response time. Parameters are defined using Liquid, and I think Liquid's replace function will be helpful here. You can use it to replace single quotes in your liquid variable's value with double quotes:

    where owner = '{{ owner | replace: "'", "''" }}'

    Let me know if you have any questions on that!

Like Follow
  • Status Answered
  • 1 yr agoLast active
  • 1Replies
  • 156Views
  • 2 Following