title: execute immediate missing right parentheses error
body: <p>I have code like below in my procedure. When I call the procedure, there is missing right parentheses error. When I test it outside the procedure, with no execute immediate clause, it works fine. 
  Would anyone help me pls to eliminate the mistake?</p>
  
  <pre class="lang-html prettyprint-override"><code>EXECUTE IMMEDIATE '
    INSERT INTO prehledcen
      (id_obchodu
      ,id_obchodu_poradi
      ,smer
      ,typceny
      ,vzdalenost
      ,hodnotaceny
      ,kid)
      SELECT a.id_obchodu
            ,a.id_obchodu_poradi
            ,smer
            ,''PredchoziLast''
            ,predchozi_last_time - datum_obchodu
            ,predchozi_last
            ,kid
          FROM middle_office.f_d_obchody_zmeny_test a
     INNER JOIN (SELECT id_obchodu
                       ,id_obchodu_poradi
                       ,MAX(dwh_insert_process) dwh_insert_process
                       ,MIN(insert_sysdate) insert_sysdate
                   FROM middle_office.f_d_obchody_zmeny_test b
                  GROUP BY id_obchodu
                          ,id_obchodu_poradi) b
        ON b.id_obchodu = a.id_obchodu
       AND b.id_obchodu_poradi = a.id_obchodu_poradi
       AND a.dwh_insert_process = b.dwh_insert_process
     WHERE (datum_obchodu &gt;= ' || v_datum_od || ' OR
           (datum_obchodu &lt; ' || v_datum_od || ' AND  b.insert_sysdate &gt;= ' || v_datum_od || '))';
  </code></pre>