ORA-01453 SET TRANSACTION must be first statement of transactionCause: A transaction was not processed properly because the SET TRANSACTION statement was not the first statement.Action: Commit or roll back the current transaction before using the statement SET TRANSACTION.
解决方案 »
- 关于动态SQL,Oracle proc的一个简单问题
- Windows XP系统使用禁忌
- oracle10安装 There were errors loading the aggregates
- 刚建的表找不到,怎么回事?
- ORACLE OEM登录问题
- ORACLE9i无法安装 大虾解决以下
- 如何打开1521端口呢?
- java.exe错误
- 求解:Oracle8.1.7在win2000Professional下的安装问题
- 高分请进:在windows下如何访问linux下的oracle数据库?有哪些方法??
- Oracle 电子商务套件 11i10首次亮相
- 请问如何利用select 或者insert语句快速生成一个和已有表机构一样的表?
OracleTransaction trans = conn.BeginTransaction(IsolationLevel.ReadCommitted);
try
{
for( int i = 0; i < inSQL.Length; i++ )
{
SQLRowIndex = i;
DBErrorSQL = inSQL[i];
if ( inSQL[ i ].CompareTo( "" ) > 0 )
{
OracleCommand OracleCommand = new OracleCommand();
OracleCommand.Connection = conn;
OracleCommand.Transaction = trans; OracleCommand.CommandText = inSQL[i]; OracleCommand.ExecuteNonQuery();
}
}
trans.Commit();
rtn = true;
}
catch( Exception e )
.......
--写的好.出现错误我想可能与你传递的sql有关系.
when others then
....
end;
这样就好了!
应该是这样:
。
OracleConnection conn = new OracleConnection( inConnString );
OracleTransaction trans = conn.BeginTransaction(IsolationLevel.ReadCommitted);
try
{}
。
谢谢!
为什么要在open之前创建 transaction?