Command window实现了SQL*Plus的所有功能,允许运行sql*plus命令,sql命令,sql脚本。
SQL window用于执行sql语句,显示sql输出,执行统计信息。(测试sql语句,查看表中的数据,更新数据)
例如 desc table不能在SQL window中执行,必须在Command window中才能执行。
在Program window中创建一个存储过程,如下:
create or replace procedure TEST is
begin
DBMS_SESSION.set_nls('NLS_DATE_FORMAT','''YYYY-MM-DD HH24:MI:SS''');
DBMS_OUTPUT.PUT_LINE('HelloWorld!');
DBMS_OUTPUT.put_line(SYSDATE);
end TEST;
需要注意,SET_NLS的第二个参数VALUE
输入的值除了需要的格式外,还需要包含引号,否则会引发错误(选项缺失或无效)
在Command window中执行(或者在Test window中测试),如下:
set serveroutput on
exec TEST();
或者begin
2 test();
3 end;
4 / ......
The Command Window can be used to develop and execute SQL scripts, using the familiar SQL*PLus command syntax. The built-in editor is a comfortable environment to develop your scripts, using SQL*Plus, SQL and PL/SQL syntax highlighting. It has the same powerful features as the PL/SQL Editor, such as the Code Assistant, the Object Popup Menu, and so on. You can quickly switch between the script editor and the command line by clicking on the tabs at the top of the window.
Just like with SQL*Plus you can interactively type single commands and SQL statements on the command line. Error messages are displayed in red, and the error location is underlined in red as well. This makes it easy to find and identify errors.
SQL window用于执行sql语句,显示sql输出,执行统计信息。(测试sql语句,查看表中的数据,更新数据)
例如 desc table不能在SQL window中执行,必须在Command window中才能执行。
在Program window中创建一个存储过程,如下:
create or replace procedure TEST is
begin
DBMS_SESSION.set_nls('NLS_DATE_FORMAT','''YYYY-MM-DD HH24:MI:SS''');
DBMS_OUTPUT.PUT_LINE('HelloWorld!');
DBMS_OUTPUT.put_line(SYSDATE);
end TEST;
需要注意,SET_NLS的第二个参数VALUE
输入的值除了需要的格式外,还需要包含引号,否则会引发错误(选项缺失或无效)
在Command window中执行(或者在Test window中测试),如下:
set serveroutput on
exec TEST();
或者begin
2 test();
3 end;
4 / ......
The Command Window can be used to develop and execute SQL scripts, using the familiar SQL*PLus command syntax. The built-in editor is a comfortable environment to develop your scripts, using SQL*Plus, SQL and PL/SQL syntax highlighting. It has the same powerful features as the PL/SQL Editor, such as the Code Assistant, the Object Popup Menu, and so on. You can quickly switch between the script editor and the command line by clicking on the tabs at the top of the window.
Just like with SQL*Plus you can interactively type single commands and SQL statements on the command line. Error messages are displayed in red, and the error location is underlined in red as well. This makes it easy to find and identify errors.