1 Reply Latest reply: Feb 20, 2013 12:12 PM by Mehr RSS

    Passing a parameter to a function to be used in  LIKE operator

    Mehr
      I am trying to pass a parameter to a function that is using the LIKE '%name_in%',
      I don't know how to use it...

      the parameter is called 'name_in'


      Thanks in advance,
      M
        • 1. Re: Passing a parameter to a function to be used in  LIKE operator
          Frank Kulash
          Hi,
          Mehrdad wrote:
          I am trying to pass a parameter to a function that is using the LIKE '%name_in%',
          I don't know how to use it...

          the parameter is called 'name_in'
          Your code should say:
          ... LIKE '%' || name_in || '%'
          If name_in is inside single-quotes, it will mean the 7 literal characters 'n', 'a', 'm', 'e', '_', 'i' and 'n'.
          You want to reference the variable called name_id, so keep the name of the variable outside the quotes.