我目前正在使用Oracle SQL Developer 4.0.1.14,做这样的事情:
UPDATE mytable SET myfield = 'myvalue' WHERE myotherfield = 234;
INSERT INTO mytable (myfield , myotherfield) VALUES ('abc', 123);
INSERT INTO mytable (myfield , myotherfield) VALUES ('abd', 124);
...
......以及更多行。
如果运行整个脚本,只能看到如下输出:
8 rows updated.
1 rows inserted.
1 rows inserted.
...
在一个小脚本中,这不是问题,因为您可以很容易地看到哪一行导致了哪个输出。但是如果你考虑使用1k行的脚本,找到更新的" 0行。"哪个命令引起了,最终会感到沮丧。
所以我宁愿想要这样的输出:
> UPDATE mytable SET myfield = 'myvalue' WHERE myotherfield = 7393;
8 rows updated.
> INSERT INTO mytable (myfield , myotherfield) VALUES ('abc', 123);
1 rows inserted.
> INSERT INTO mytable (myfield , myotherfield) VALUES ('abd', 124);
1 rows inserted.
...
我知道,在详细模式下运行脚本时,可以在Sql * Plus中实现。但是在SQL Dev中这也应该是可能的,不应该吗?
如果有人能告诉我如何,我将非常感激。
非常感谢!
答案 0 :(得分:5)
尝试使用set echo on(sqlplus命令也适用于sql developer),例如
create table t(a varchar2(100));
set echo on
update t set a = 0;
update t set a = 0;
update t set a = 0;
输出(在F5之后 - 运行脚本)
table T created.
> update t set a = 0
0 rows updated.
> update t set a = 0
0 rows updated.
> update t set a = 0
0 rows updated.