title: Using the quote operator in Oracle to insert a semi-colon
body: <p>I have the following SQL for updating CSS in an existing table,</p>
  
  <pre><code>SET DEFINE OFF;
  
  UPDATE SCHEMANAME.template
     SET body = q'[
  &lt;style type="text/css"&gt;
    #header {
      background-color:#004F5D;
      height:100px;
      position:relative;
    }]'
  WHERE name = 'CSS';
  </code></pre>
  
  <p>The template table has the following structure,</p>
  
  <pre><code>NAME    NOT NULL VARCHAR2(150)
  SUBJECT NOT NULL VARCHAR2(4000)
  BODY    NOT NULL CLOB
  VERSION NUMBER(18)
  </code></pre>
  
  <p>However, when I run the update statement with sqlplus I receive,</p>
  
  <pre><code>ERROR:
  ORA-01756: quoted string not properly terminated
  
  SQL&gt; SP2-0734: unknown command beginning "height:100..." - rest of line ignored.
  SQL&gt; SP2-0734: unknown command beginning "position:r..." - rest of line ignored.
  SQL&gt; SP2-0042: unknown command "}]'" - rest of line ignored.
  </code></pre>
  
  <p>I'm using,</p>
  
  <pre><code>SQL*Plus: Release 11.2.0.4.0 Production
  </code></pre>
  
  <p>and for Oracle,</p>
  
  <pre><code>Oracle Database 11g Release 11.2.0.4.0 - 64bit Production
  PL/SQL Release 11.2.0.4.0 - Production
  CORE    11.2.0.4.0  Production
  TNS for Linux: Version 11.2.0.4.0 - Production
  NLSRTL Version 11.2.0.4.0 - Production
  </code></pre>
  
  <p>It looks to me as though sqlplus is getting upset about the semicolon character at the end of the first declaration inside the header block.</p>
  
  <p>I've tried issuing,</p>
  
  <pre><code>SET ESCAPE OFF
  </code></pre>
  
  <p>before running the update statement and the issue remains. </p>
  
  <p>I can work around this by wrapping the UPDATE inside a BEGIN-END block.
  Is this the only way to make this work?</p>
  
  <p><strong>Does the quote-operator have issues with ';' within a block?</strong></p>