zoukankan      html  css  js  c++  java
  • WHENEVER SQLERROR EXIT AND DML

    1.
    SQL> create table test_dml(id int);
    
    Table created.
    
    SQL> select * from test_dml;
    select * from test῟dml
                      *
    ERROR at line 1:
    ORA-00911: 无效字符
    
    
    SQL> select * from test_dml;
    
    no rows selected
    
    
    
    [oracle@yyjk 20190430]$ cat all.txt 
    WHENEVER SQLERROR EXIT
    @a1.sql
    COMMIT;
    @a2.sql
    COMMIT;
    [oracle@yyjk 20190430]$ 
    [oracle@yyjk 20190430]$ cat a1.sql 
    insert into test_dml values(111);
    insert into test_dml values('aaa');
    
    [oracle@yyjk 20190430]$ cat a2.sql
    insert into test_dml values(222);
    insert into test_dml values('bbb');
    
    
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    [oracle@yyjk 20190430]$ sqlplus tlcbuser/tlcbuser
    
    SQL*Plus: Release 11.2.0.4.0 Production on 星期二 4月 30 15:42:56 2019
    
    Copyright (c) 1982, 2013, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    SQL> @all.txt
    
    1 row created.
    
    insert into test_dml values('aaa')
                                *
    ERROR at line 1:
    ORA-01722: 无效数字
    
    
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    [oracle@yyjk 20190430]$ 
    
    
    Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    SQL> select * from test_dml;
    
     ID
    ----------
           111
    
        
    此时111已经被插入了
  • 相关阅读:
    ngix反向代理-之反向
    redux和flux究竟有什么不同, 说点自己的理解
    npm发包记录
    由一个聚焦-focus-事件异常跟踪引起的总结
    git查看分支的几个方法
    test-your-mind-快速测试自己的代码
    contos7 yum安装php7.2与swoole (2)
    php_ thinkphp 时间回滚
    30个php操作redis常用方法代码例子
    redis_php 安装与卸载
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13348786.html
Copyright © 2011-2022 走看看