提交事务:commit
保存事务点:savepoint name
回滚事务:rollback( to savepoint name)

解决方案 »

  1.   

    怎么开始:定义开始事务??
    提供一个PROCEDURE的使用实例,谢谢!1
      

  2.   

    oracle使用隐式事务,不需要定义事务开始,第一个sql语句自动开始一个事务,直到commit/rollback/ddl命令该事务结束。之后的第一个sql语句又自动开始一个事务。
      

  3.   

    怎么开始:定义开始事务??
    提供一个PROCEDURE的使用实例,谢谢!
    没有人帮忙吗!!!
      

  4.   

    在想提交的地方,加上commit。
      

  5.   

    create or replace procedure pro_testa as
    begin
        insert into tabela(id,name) values(1,'OK');
        commit;  <-----提交
        exception 
            when others then 
                rollback;       <--------如果出错则回滚.
    end
      

  6.   

    上面说的隐式事务太简单了,功能太弱小了:
    我的意思是怎么“开始一个事务”,没有一个人能给出一个格式:
    比如我要定义多个嵌套事务,怎么开始呢,怎么COMMIT多个嵌套事务呢,一个隐含事务做不到了!就像SQL server的 BEGIN TRAN 类似的东东,
    ORACLE版就没有高手??????
      

  7.   

    ....
    commit;
    exception 
    when others then 
     rollback;
    ...
      

  8.   

    如果你想提交一起执行一起回滚.用savepoint
      

  9.   

    oracle不提供begin tran之类的命令没有这个必要
      

  10.   

    sql sever中的begin transaction是为了控制事务的一致性,在oracle中已经有了commit,和exception , 可以满足需求了,
      

  11.   

    受sqlserver的毒害太深。要知道sqlserver没有办法解决好并发性问题,搞了个自动提交模式(而且是缺省模式),所以才有begin tran命令。
      

  12.   


    create or replace procedure pro_testa as
    begin
        insert into tabela(id,name) values(1,'OK');
        commit;  <-----提交
        exception 
            when others then 
                rollback;       <--------如果出错则回滚.
    end
    就可以了
      

  13.   

    如果你想实现嵌套事务,可以用savepoint啊先savepoint name
    然后rollback( to savepoint name)
      

  14.   

    create or replace procedure pro_testa as
    begin
    savepoint name    insert into tabela(id,name) values(1,'OK');
        commit;  <-----提交
        exception 
            when others then 
                rollback;       <--------如果出错则回滚.
    end
      

  15.   

    create or replace procedure pro_testa as
    begin
        savepoint mystart;---start save point
        insert into tabela(id,name) values(1,'OK');
        commit;  <-----提交
        exception 
            when others then 
                rollback mystart;       <--------如果出错则回滚 to mystart.
    end
      

  16.   

    create or replace procedure pro_testa as
    begin
        savepoint mystart;---start save point
        insert into tabela(id,name) values(1,'OK');
        commit;  <-----提交
        exception 
            when others then 
                rollback to mystart;       <--------如果出错则回滚 to mystart.
    end
      

  17.   

    to drabit:
    SQL SERVER 不是自动提交事务的;不信回去些个procedure试一下??
      

  18.   

    to andzen(阿风):
       sql server 是否自动提交事务跟连接参数有关。   看来你对sql server了解的很少,还需要学习一下事务模式的概念
       
       
      
      

  19.   

    to drabit:
    你不是说SQL server是自动提交的吗,怎么现在又反悔,我只是就事论事,哈哈,至于谁了解的少,自己心里自然明白,不必在这里争这个
      

  20.   

    to  andzen(阿风): 下面是我的原话: 《要知道sqlserver没有办法解决好并发性问题,搞了个自动提交模式(而且是缺省模式),所以才有begin tran命令。》 你居然能理解为“SQL server是自动提交的”,你的理解能力确实有问题。