SQL> select * from v$version ;BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
create table t1 (id number);
2.建立如下脚本,注意注解*后面的方式,1个*后无空格一个后面有空格.
$cat aa.sql
insert into t1 values (1);
/*this is a test*/
/* this is a test*/
commit ;
select * from t1;
/*+this is a test*/
SQL> @aa.sql
1 row created.
1 row created.
Commit complete.
ID
----------
1
1
--可以发现插入两个记录.
3.手工执行如下:
SQL> insert into t1 values(101);
1 row created.
SQL> /*+aaa*/
SQL> /*aaa*/
1 row created.
SQL> commit ;
Commit complete.
SQL> select * from t1;
ID
----------
1
1
101
101
SQL> /* ccc*/
SQL> /*+ ccc*/
SQL> /*ccc*/
ID
----------
1
1
101
101
--说明写注解要注意!不知道这个算oracle的bug吗?好像其他版本也有!