title: SQL: Preparation of SQL query fails. But is executed when done manually
body: <p>I am getting an error which can be seen below when I am preparing the query:</p>
  
  <pre><code>SQL-ERR:Preparation of INSERT Query Failed: Ora-Err: -1756 ORA-01756: 
  quoted string not properly terminated
  </code></pre>
  
  <p>The query is as follows:</p>
  
  <pre><code>EXEC SQL declare INSDTA STATEMENT;
  EXEC SQL PREPARE INSDTA FROM :stmt;
  if(sqlca.sqlcode &lt; 0)
  {
      DEBUG_LOG("SQL-ERR:Preparation of INSERT Query Failed: Ora-Err: %d %s\n", sqlca.sqlcode, sqlca.sqlerrm.sqlerrmc);
      DEBUG_LOG("The Query is: %s\n", insertQuery);
      return PREPARATION_FAILURE;
  }
  </code></pre>
  
  <p>And the query from the log file is:</p>
  
  <pre><code>INSERT INTO TABLENAME
  VALUES (
      '00000001',
      '00004467',
      '0',
      'R56565',
      '03404395',
      '20110601',
      '999',
      '87685785',
      '2017-01-10-23.05.26.000000',
      'KRMAR',
      'KRMAR',
      '77898878',
      '03',
      '00000001',
      'U',
      '01',
      '1',
      '87685785',
      'R56565',
      '89878988',
      'cde',
      'Andr\351',
      'andre.rae@abc.com',
      '01192966',
      'HGJF',
      '00000000',
      '',
      '900429',
      '1',
      '98989897',
      '',
      'Aargau / Solothurn (CIC)',
      'VCD',
      'RB9',
      'VCD',
      'Observer'
      )
  </code></pre>
  
  <p>If I execute it manually, the data is getting inserted. </p>
  
  <p>But programatically it is failing for many such rows.</p>
  
  <p>Note that the input text for insert query contains special chars like <code>é</code>, <code>ü</code>. </p>
  
  <p>Also, the same program is working on development system perfectly. But on the production, it is failing. </p>
  
  <p>Manual insertion is working on production properly.</p>
  
  <p>What might be the issue?
  Any configuration issues?</p>
  
  <p>Thanks in advance.</p>