title: Concat CLOB in PL/SQL for execute immediate
body: <p>I need to change a functions signature to have a parameter (p_param) of type CLOB, the previous type was nvarchar2.  This caused me trouble when existing code was using || to concat.</p>
  
  <p>Here is the existing snippet, that worked just fine for the NVarchar2, but apparently when you use || to concat a CLOB it treats it like a nvarchar2, which is a problem when the character limit of nvarchar2 is exceeded.</p>
  
  <pre><code> execute immediate    
      'select p.person_id 
       from person p where p.id in (' || p_param || ')'
   bulk collect into persons;
  </code></pre>
  
  <p>I tried to change the above snippet to be</p>
  
  <pre><code>  execute immediate   
     concat(concat('select p.id from person p where p.person_id in(',p_param),')')
    bulk collect into members;
  </code></pre>
  
  <p>This doesn't compile, I get an error,</p>
  
  <blockquote>
    <p>PLS-00382: expression is of wrong type</p>
  </blockquote>
  
  <p>I am new to PL/SQL, thanks for the help.</p>