PL/SQL Command Window的使用

个人对于工具的理解,只有真正熟悉了之后才会理解其强大。

1. 先谈一下诸 Window(PL/SQL Developer)

     RT:
RT

  • PW(程序窗口):
    可以执行 sql,sqlplus 相关的语句,例如存储过程,方法,一般用来开发程序用的。
  • TW(测试窗口):
    一般是用来测试存储过程等的debug。
  • SW(SQL窗口):
    执行的是dml,ddl语句,主要用户语句的查询、显示、执行统计信息等(应用最多的一个窗口)。例如 desc table不能在SQL
    window中执行,必须在Command window中才能执行。
  • RW(报告窗口):
    方便用于展示有聚合查询的用图表形式展示的窗口,例如sum(),count()等,有x,y轴的。
  • CW(命令窗口):
    除了可以执行sql/sqlplus 相关的命令、sql脚本,还可以执行更多的命令,例如call 等。
  • EPW(解释计划窗口):
    解释执行计划的,调优时,经常用到。
  • DW(图表窗口):
    画图表的,如果后面用到,补充具体使用细节。

2. 我的有关 CW 的实验
  • Extra Cookies
    • set serveroutput on
      打开oracle自带的输出方法dbms_output。在执行set serveroutput on以后,使用dbms_output方法可以输出信息。例如:dbms_output.put_line(‘This is’);
    • Oracle的 edit 命令
      在 CW 窗口中,运行PL/SQL语言的时候,edit命令用的很多,便于编辑执行的SQL语句。
-- 实验中用到的相关SQL语句

-- 1. 建表语句
create table MYTABLE1
(
  id   VARCHAR2(20),
  name VARCHAR2(20),
  age  INTEGER
);

-- 实验用到的PL/SQL 语言
BEGIN
for i in 1 .. 10 loop
    insert into MYTABLE1 values(i,'dev',1);
end loop;
end;
/
  • 使用PL/SQL语言循环向mytable表循环插入数据,执行结果如下图:
    table1

  • 使用 edit 命令修改,执行结果:
    edit

  • / 执行结果:
    /

  • 补充,最近在实战时,需要更新某些有特点的字段,认识了 NOT LIKE(Oracle) 的用法。不得不说,有时候,见多识广还是很有期必要性的!
  • 具体用法不在啰嗦,分享几篇筛选的相关文章。

  • 个人感觉,虽然题目立足于PL / SQL,单这篇博文写的东西较多,较杂。没办法,单独立文,内容较少;合而为一,又显得有些杂乱,不过确实可以起到一定开阔视野的作用,谢!
  • 7
    点赞
  • 35
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
32位版本的 PLSQL 正式版。 安装请查看说明。 APRIL 17, 2020 - VERSION 14.0 RELEASED Built-in Version Control support for Git and Subversion For these file control operations PL/SQL Developer relies on a 3rd party shell extension that must be installed on your system. In the screenshots above “GIT Extensions” has been used. Worksets A workset is a set of Program Windows, SQL Windows, Test Windows, Command Windows, Report Windows and Diagram Windows that you are working on. Internal difference viewer The new viewer allows you to ignore differences in case and white space as usual, but it can also ignore differences in comments. Program Window enhancements The Program Window now highlights transaction statements, so that you can visually recognize the code that affects a transaction. As soon as you place the cursor on a transaction statement, all related statements within a program unit will be highlighted Debugger enhancements A variable name and value can now be copied to the clipboard through the new “Copy variable” popup menu item. Editor enhancements A function key “Editor: Refresh Code Assistant” has been added, to bring the Code Assistant up to date after creating new database objects. When selecting a word, all matching words will be highlighted. Marked editor text is automatically copied to the search field of the Find function. SQL Window enhancements You can now display multiple result sets simultaneously and can compare them: CLOBs and BLOBs are now fetched on demand to improve query performance. Single record view will now show column comments if available. The EXCEL and CSV export filenames can now include substitution variable values. The EXCEL and CSV export filenames can now include %time%, %hh%, %mi% and %ss% variables. For the “Export Results as SQL file” function you can now customize the initialization and finalization. The WITH_PLSQL hint is now supported. Command Window enhancements New EXPORT TABLES and EXPORT OBJECTS commands have been added. This allows you to automate frequent export jobs. You can easily build the command-line from the interactive export tools. The BEAUTIFY <file> command now supports wildcards. The CONNECT command now shows the database list after typing @. The WITH_PLSQL hint is now supported. Object Browser enhancements The Object Browser will now show all overloaded versions of functions and procedures. You can now filter on multiple comma-separated object names (e.g. “dept%, emp%”). You can now refresh materialized views from the popup menu. File Browser enhancements Git and Subversion support has been added. File icons now indicate the PL/SQL Developer file type. You can now filter files based on the name, size, date, read-only status, and version control status. You can specify the filter in the options dialog You also can enter the filter expression directly at the top of the File Browser All windows shell functions are now available from the popup menu. You can now create a specific PL/SQL Developer file type from the “Create File” popup menu item. You can now add multiple files to a project at once. Project enhancements Git and Subversion support has been added. File icons now indicate the PL/SQL Developer file type. Table Definition Editor enhancements The Index and Partition storage can now be edited, copied, and pasted directly in the grid. Support for Row Archival has been added. Test Manager enhancements You can now add multiple Test Script files at once. You can now drag & drop Test Script files from the File Browser. You can now enable or disable multiple items at once. Connection List enhancements Window icons now indicate the PL/SQL Developer window type. Connection status icon moved to the left for consistency. Session Window enhancements You can now define Session Actions that can be performed from the popup menu of the session list: Session Actions can display feedback by writing dbms_output. Other enhancements Function keys have been added for “Search Bar” functions (Focus, Search, Go to next, Go to previous). Substitution variable checkbox and list values can now refer to other variable values as &variable. An “Unregister License” function has been added. Fixes Fixes for multiple monitors with different display scaling (file selector, print dialogs, MDI window title bars, scrollbar width) Conditional sections could be displayed incorrectly in the Code Contents Define Connections and Select Connection tree was incorrect on a secondary display with different DPI settings Menu items with icons from templates were too small on high dpi monitors Ribbon / Menu customization form options were not preserved Editors with a right margin and wrapping enabled did not wrap at the right margin View Stack Dump function now places the error lines in center of the editor Connection matches did not process proxy user expressions (user1[user2]@database) correctly for the application background DBMS_Jobs could not be edited on Oracle19 (‘xxxx’ is not a valid
64位版本的 PLSQL 正式版,只能运行在64位系统中,需要你安装 64 位的 Oracle 客户端。 安装请查看说明。 JUNE 4, 2020 - VERSION 14.0.1 RELEASED Enhancements Language packs updated for 14.0 features Large Data Editor did not show in Single Record View in the SQL Window Selection > Uncomment would remove /* and */ in string constants Window List did not conform to the “Short Text” setting for Difference Viewer windows The Difference Viewer window did not always have a correct title Cut and Paste did not work in the SQL Window in Single Record View Code Assistant would display urowid parameters as “Unknown type 104” Table Definition Editor Index Column Selector would convert string expressions to lowercase Entering a value with square brackets when executing a template would interpret the square brackets as a variable Key Configuration items for File / New / Program Window were missing The Command Window BEAUTIFY command did not conform to the Files / Format / Linebreaks preference The Project desktop file (project.dsk) is now portable Using the “SQL Window: Hide Editor” function would incorrectly reposition the vertical splitter The Debugger did not always show correct variable values in local subprograms Object Browser Filter “My invalid objects” would raise ORA-00918 when opening the Triggers folder Clicking on Window List items did not always work correctly after changing the display File Locations import/export functions added File Browser directory popup items added for Git Clone and Subversion Checkout Change All Lines popup menu item added to the Diagram Window Fixes for multiple monitors with different display scaling (file selector, print dialogs, MDI window title bars, scrollbar width) were not available in the 64 bit version The “Close unused connections” preference could cause delays when closing a window or when changing the main connection The Quick Access Toolbar in Full Screen mode on Windows 10 was transparent

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

xsimah

创作不易,感谢客官的打赏

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值