Oracle MERGE statement not 'sticking' using DevArt dotConnect for Oracle

≡放荡痞女 提交于 2019-12-25 05:52:09

问题


I'm using an Oracle MERGE statement in dotConnect for Oracle, I know that the MERGE itself is fine as runs in P-Sql and SQL Developer, yet using the dotConnect and ExecuteNoQuery the query is apparently successful (no exceptions thrown) but the table has had no updates or inserts taken place.

I can break the query into an Update and an Insert and they stick ok.

Any Ideas ?


回答1:


We have answered to you at our forum: http://forums.devart.com/viewtopic.php?f=1&t=29549

As a workaround, you can try using:

1) the OCI mode;

or

2) this code:

OracleConnection conn = new OracleConnection("User Id=user;Password=pass;Server=dboracle;SID=sid;Direct=true");
conn.Open();
OracleTransaction t = conn.BeginTransaction();
OracleCommand comm = new OracleCommand(@"MERGE INTO ...");// place here your merge statement
comm.Transaction = t;
comm.Connection = conn;
comm.ExecuteNonQuery();
t.Commit();


来源:https://stackoverflow.com/questions/23601304/oracle-merge-statement-not-sticking-using-devart-dotconnect-for-oracle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!