title: How to change to dynamic sql escape by using REPLACE function
body: <p>so I try to change this code to dynamic SQL    </p>
  
  <pre><code>SELECT  LISTAGG(accounting_dept || '-'||REPLACE(full_desc,'''',''''''), '; ') WITHIN GROUP (ORDER BY accounting_dept)  FROM table
  </code></pre>
  
  <p>excute</p>
  
  <pre><code>12121-President''S Office
  </code></pre>
  
  <p>I changed to dynamic sql</p>
  
  <pre><code>EXECUTE IMMEDIATE
      ' SELECT  LISTAGG(accounting_dept || ''-''||REPLACE(full_desc,'''''',''''''''), ''; '') WITHIN GROUP (ORDER BY accounting_dept)  FROM table '
  
  INTO v_task;
  </code></pre>
  
  <p>the error is  ORA-00907: missing right parenthesis</p>
  
  <p>The problem is this part REPLACE(full_desc,'''''',''''''''),</p>
  
  <p>how can I change to dynamic sql without the cauing error?</p>