问题
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