Oracle MERGE语句未使用DevArt dotConnect for Oracle进行“粘贴" [英] Oracle MERGE statement not 'sticking' using DevArt dotConnect for Oracle
问题描述
我在dotConnect for Oracle中使用Oracle MERGE语句,我知道MERGE本身可以在P-Sql和SQL Developer中运行,但是使用dotConnect和ExecuteNoQuery查询显然是成功的(没有抛出异常)但该表未进行任何更新或插入.
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.
有什么想法吗?
推荐答案
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)OCI模式;
或
2)此代码:
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();
这篇关于Oracle MERGE语句未使用DevArt dotConnect for Oracle进行“粘贴"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!