pl/sql中command window 与sql window有什么区别

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.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值