在plsql里执行了update操作,然后再select看结果,显示数据已经更新,但是到sqlplus里看时,记录并未更新,请问何解?只是在内存中更新,没有实际更新数据库?谢谢指教

解决方案 »

  1.   

    你没有执行
    commit tran;
    语句
      

  2.   

    当对数据表进行insert ,update,delete时,都要执行commit语句,数据才是真正的提交,也就是修改了原始数据
      

  3.   

    SQL> update aaa set a=-1 where b='2008',commit;
     
    update aaa set a=-1 where b='2008',commit
     
    ORA-00933: SQL command not properly ended怎么会报错呢
      

  4.   

    是先执行update然后回车写commit;回车?
    能不能通过一个回车就搞定?
      

  5.   

    SQL> update aaa set a=-1 where b='2008';
     
    1 rows updated
     
    SQL> commit;
     
    Commit complete
     
      

  6.   

    SQL> begin update aaa set a=-1 where b='2008';commit; end;
      2  /
     
    PL/SQL procedure successfully completed
      

  7.   

    你中间有个逗号怎么呢不报错?
    update aaa set a=-1 where b='2008';
    commit;
    这样没问题了
      

  8.   

    SQL> update aaa set a=-1 where b='2008';
    SQL> commit; 
      

  9.   


    按你这样写后,在写命令怎么写?目前按回车都是序号递增了,没有出现SQL>
      

  10.   


    我的意思是执行成功了,但是我要写别的sql语句的时候,没有出现SQL>这个了,按回车后就另起一行以3开头,再回车,又另起一行4开头,如此类推,但是就没有SQL>前缀了,导致我后面的sql语句不能写了,这个怎么解决?