How can I avoid that this java.sql.SQLException: ORA-01704: string literal too long is thrown? -


i working on old legacy java application , have problem method perform simple insert query on oracle database:

private boolean insertflussoxmlsdi(dboperatore op, string numerofattura, string datafattura, string fatturaxml) {      stringbuffer query = new stringbuffer();      query.append("insert flusso_xmlsdi (numero_fattura, data_emissione, xml) values (");     query.append(numerofattura);     query.append(", date'");     query.append(datafattura);     query.append("', '");     query.append(fatturaxml);     query.append("')");       try {         statement stmt = op.getconnessione().createstatement();         stmt.execute(query.tostring());      } catch (sqlexception e) {         // todo auto-generated catch block         e.printstacktrace();          tracelog.scrivi("inserimento fattura", "errore inserimento fattura con numero fattura: " + numerofattura, false, tracelog.lowconsole + tracelog.hightrace + tracelog.highlog);          return false;     }      tracelog.scrivi("inserimento fattura", "inserimento fattura con numero fattura: " + numerofattura, false, tracelog.lowconsole + tracelog.hightrace + tracelog.highlog);      return true;  }     

the problem string fatturaxml paramether represent xml file , pretty big. when previous query performed obtain exception thrown:

java.sql.sqlexception: ora-01704: string literal long 

how can solve issue , correctly insert record?

tnx

if 1 tries insert data greater 4000 characters column - varchar2 , error ora-01704. check below post

error : ora-01704: string literal long


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -