oracle 语句级事务测试

SQL*Plus: Release 10.2.0.1.0 - Production on 星期二 1 2 11:42:55 2007

Copyright (c) 1982, 2005, Oracle. All rights reserved.

连接到:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production

With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options

SQL> create table test1(t1 VARCHAR2(10),t2 NUMBER(9,2));

表已创建。

SQL> create table test2(t1 VARCHAR2(10),t2 NUMBER(9,2));

表已创建。

SQL> insert into test1 values ('a',10);

已创建 1 行。

SQL> insert into test2 values ('b',10);

已创建 1 行。

SQL> commit;

提交完成。

SQL> select * from test1;

T1 T2

---------- ----------

a 10

SQL> select * from test2;

T1 T2

---------- ----------

b 10

SQL> update test1 set t2=t2+1;

已更新 1 行。

SQL> update test2 set t2=t2+1 where t2=t1;

update test2 set t2=t2+1 where t2=t1

*

1 行出现错误:

ORA-01722: 无效数字

SQL> commit;

提交完成。

SQL> /

提交完成。

SQL> select * from test1;

T1 T2

---------- ----------

a 11

SQL> select * from test2;

T1 T2