title: Oracle equivalent to SQLite's quote() function
body: <p>Sometimes I want to generate <code>INSERT</code> statements from the contents of a database table.</p>
  
  <p>With SQLite, I can do:</p>
  
  <pre><code>SELECT 'INSERT INTO foo (col1, col2) VALUES (' || quote(col1) || ',' || quote(col2) || ');'
    FROM bar;
  </code></pre>
  
  <p>With Oracle, I have to do :</p>
  
  <pre><code>SELECT 'INSERT INTO foo (col1, col2) VALUES (''' || replace(col1, '''', '''''') || ''',''' || replace(col2, '''', '''''') || ''');'
    FROM bar;
  </code></pre>
  
  <p>And furthermore, it won't work with NULL values.</p>
  
  <p>Is there a better way?</p>