c# - Oracle CLOB storing Arabic Numbers in form of '?' -
i working on desktop c# application. 1 of field of type clob. data enter assign in c# based variable upon storing value in oracle store number '?'. instance if string hi۱۲۳, upon storing becomes hi???
it happening number, rest of text in arabic text saves fine.
upon running query:
select dump(content) mytable
gives error:
[err] ora-00932: inconsistent datatypes: expected - got clob
below code insert clob
public void insertclob(string sqlstatement, string str) { system.data.oracleclient.oracledatareader rstoracle = null; system.data.oracleclient.oraclecommand sqlcommandoracle = null; system.data.oracleclient.oracletransaction txn = null; system.data.oracleclient.oraclelob clob = null; try { if (sqlstatement.length > 0) { if (myconnection.state.tostring().equals("open")) { byte[] newvalue = system.text.encoding.unicode.getbytes(str); sqlcommandoracle = new system.data.oracleclient.oraclecommand(sqlstatement, myconnection); rstoracle = sqlcommandoracle.executereader(); rstoracle.read(); txn = myconnection.begintransaction(); clob = rstoracle.getoraclelob(0); clob.write(newvalue, 0, newvalue.length); txn.commit(); console.writeline("clob updated"); } } } catch (exception ex) { console.writeline(ex.targetsite + " - " + ex.message); } { sqlcommandoracle.dispose(); rstoracle.close(); txn.dispose(); clob.close(); } }
Comments
Post a Comment