title: handle special characters in PL/SQL procedures.?
body: <p>I'm using oracle 10g plsql procedures for inserting and listing, but if we have any special characters like <code>'</code> (single quote ) and <code>&amp;</code> etc. query fails. How to handle special characters in plsql?</p>
  
  <p>before: </p>
  
  <pre><code>    lquery := 'select count(id) into lCount
                          From
                              dual
                          where
                              name = '||iName||'
                           and Id= '||iId
  </code></pre>
  
  <p>after: </p>
  
  <pre><code>     select into lCount
                          From
                              dual
                          where
                              Id= iId
                           and name = iName;
  </code></pre>
  
  <p>after changing the query its working fine. Problem is if we keep variable like name value inside single quotes some times query wont execute for special characters like <code>' , "</code> etc after changing query its working fine. </p>