BUG如下:
23:24:13 @> conn oe/oe@cry
已连接。
23:24:25 OE@cry> /* test */
23:24:38 OE@cry> /* test */select count(*) from orders;
COUNT(*)
----------
105
已用时间: 00: 00: 00.05
直接写注释,或者注释写在前面还是可以的,这里要注意/*后有一个空格(为什么需要这个空格下面会有解释)
如果此时我们输入ed,调用编辑器进行命令编辑的时候,这样写入内容
/*test comment*/select count(*) from orders
或者这样写
/*test comment*/
select count(*) from orders
或者这样
--test comment
select count(*) from orders
那么将会提示错误:ORA-24374: 在读取或执行并读取之前没有完成定义,
实践如下:
23:24:53 OE@cry> ed
已写入 file afiedt.buf
1* /*test comment*/select count(*) from orders
23:25:15 OE@cry> /
/*test comment*/select count(*) from orders
*
第 1 行出现错误:
ORA-24374: 在读取或执行并读取之前没有完成定义
已用时间: 00: 00: 00.01
23:25:18 OE@cry> ed
已写入 file afiedt.buf
1 /*test comment*/
2* select count(*) from orders
23:28:27 OE@cry> /
/*test comment*/
*
第 1 行出现错误:
ORA-24374: 在读取或执行并读取之前没有完成定义
已用时间: 00: 00: 00.01
23:35:03 OE@cry> ed
已写入 file afiedt.buf
1 --test commment
2* select count(*) from orders
23:35:17 OE@cry> /
--test commment
*
第 1 行出现错误:
ORA-24374: 在读取或执行并读取之前没有完成定义
另外一个(解释上面/*后为什么要带空格的情况)
如下:
23:28:29 OE@cry> select count(*) from orders;
COUNT(*)
----------
105
已用时间: 00: 00: 00.00
23:30:34 OE@cry> /*test001*/select 123 from dual;
COUNT(*)
----------
105
已用时间: 00: 00: 00.01
不同的SQL竟然产生一样的结果(注意这里的/*后面没有空格),如果有空格又正常了
23:31:06 OE@cry> /* test001*/select 123 from dual;
123
----------
123
已用时间: 00: 00: 00.01
以上应该算sqlplus注释的一个小BUG吧。