title: Use of variable in LIKE condition of PL/SQL
body: <p>I have a requirement where I need to search all records like '00456159/%'.
  In database there are two records 00456159/A and 00456159/I. But in the below code that I'm using it does not give any of the records.Can someone point out the mistake that I'm doing? Thanks,</p>
  
  <pre><code>SET SERVEROUTPUT ON;
  DECLARE
  
  Cursor c2(v_comp IN VARCHAR2) is select  distinct rate_agreement_nbr rag FROM APL_PRICING.rate_agreement 
  WHERE  RATE_AGREEMENT_NBR like   ''''||v_comp||'%'||'''';
  
  v_comp1 VARCHAR2(15);
  
  BEGIN
  
  v_comp1 :=SUBSTR('00456159/A',1,9);
  
  For v_rec in c2(v_comP1)
  loop
      DBMS_OUTPUT.PUT_LINE(v_rec.rag);
  end loop;
  
  END;
  </code></pre>