Using Notepad++ to Execute Oracle SQL
Notepad++是一个很实用的文本编辑工具,用它来执行Oracle SQL也很有意思,虽然不太实用,或许在某些场合会有用吧。
在此复制原文只作记录,原文见如上链接。
原文如下:
Toad for Oracle is the single most robust and powerful IDE (Integrated Development Environment) and DBA tool for all your Oracle database needs. It’s a veritable nuclear powered, Swiss army knife capable of grand accomplishments. However there may well be times where you need a smaller, focused and thus simpler tool for modest tasks – such as opening and running a straightforward SQL script, where you might make minor changes such as setting a different script variable value at the top. Yet you still expect important features such as syntax highlighting for readability. For those specific, lesser needs I often use the popular freeware editor Notepad++. However it requires some manual tweaking in order to have Notepad++ execute SQL via Oracle’s SQL*Plus. In this blog I’ll show you how.
Note: The astute reader might ask “Why not just use Toad’s free QSR utility (i.e. Quest Script Runner -- it ships with every copy of Toad for Oracle) which looks and operates the same way as the Toad Editor, but it only includes a subset of the Editor's features?” – shown below in Figure 1. The answer is simple – people like choices and many people know and prefer Notepad++ as their standard Windows Notepad replacement and editor of choice for most simple needs.
Figure 1: Quest Script Runner Example
So let’s see how to enable Notepad++ to work much like QSR – where Notepad++ is the basic editor and spawns SQL*Plus to run the editor contents. It may not be as well integrated or flexible as QSR, but once again it’s what many people know and prefer for basic editing. Figure 2 shows the same script execution results as Figure 1.
Figure 2: Notepad++ Example
Here are the steps:
- Launch Notepad++
- Main menu -> Plugins -> Plugin Manager -> Show Plugin Manager
- Available Tab, Find and check NppExec plugin (see Figure 3 below)
- Press Install button to download & install plugin – restarts Notepad++
- Open a SQL script
- Press F6 key (NppExec’s default execute keyboard mapping)
- Enter the following macro script into the Execute pop-up (see Figure 4 below) set ORA_USER=bert set ORA_PASS=bert1234 set ORA_SID= ORCL npp_save cmd /c copy /y "$(CURRENT_DIRECTORY)\$(FILE_NAME)" "$(SYS.TEMP)\$(FILE_NAME)" >nul 2>&1 cmd /c echo. >> "$(SYS.TEMP)\$(FILE_NAME)" cmd /c echo exit >> "$(SYS.TEMP)\$(FILE_NAME)" sqlplus -l $(ORA_USER)/$(ORA_PASS)@$(ORA_SID) @"$(SYS.TEMP)\$(FILE_NAME)"
- Change the first three variables for your database, username and password
- Press the OK button
Figure 3: Notepad++ Plugin Manager – Enable NppExec
Figure 4: Save your SQL*Plus execute macro
Using Notepad++ to Execute Oracle SQL的更多相关文章
- Oracle SQL explain/execution Plan
From http://blog.csdn.net/wujiandao/article/details/6621073 1. Four ways to get execution plan(anyti ...
- [Oracle] SQL*Loader 详细使用教程(2)- 命令行参数
sqlldr工具 SQL*Loader的客户端工具是sqlldr,在操作系统的命令行下输入sqlldr,后面不接任何参数,将显示帮助信息如下所示(所有命令行参数的简单描述及其默认值),所以你并不需 ...
- Oracle SQL语句追踪
Oracle SQL语句追踪 1 SQL语句追踪 追踪SQL语句的执行过程需要在Oracle服务器端进行,Oracle服务器端会检测并记录访问进程所执行的所有SQL语句.下面使用的命令都是在命令行 ...
- [转]Advanced Oracle SQL Developer Features
本文转自:http://www.oracle.com/technetwork/cn/server-storage/linux/sqldev-adv-otn-092384.html Advanced O ...
- [转]How to: Execute Oracle Stored Procedures Returning RefCursors
本文转自:http://www.telerik.com/help/openaccess-orm/openaccess-tasks-oracle-execute-sp-result-set.html I ...
- Oracle SQL 语言分类
Oracle SQL语句分类 2008-06-17 11:15:25 分类: Linux * 2008/06/17 星期二*蒙昭良*环境:WindowsXP + Oracle10gR2*Oracl ...
- java.lang.ClassCastException: oracle.sql.CLOB cannot be cast to oracle.sql.CLOB
错误现象: [framework] 2016-05-26 11:34:53,590 -INFO [http-bio-8080-exec-7] -1231863 -com.dhcc.base.db.D ...
- Oracle SQL高级编程——分析函数(窗口函数)全面讲解
Oracle SQL高级编程--分析函数(窗口函数)全面讲解 注:本文来源于:<Oracle SQL高级编程--分析函数(窗口函数)全面讲解> 概述 分析函数是以一定的方法在一个与当前行相 ...
- Oracle SQL 硬解析和子游标
Oracle SQL 硬解析和子游标 What reasons will be happening sql hard parse and generating new child cursors 在一 ...
随机推荐
- mvc 的 OutputCache
有人问.有没有类似asp.net web form 一样的那种标头 缓存 [OutputCache(Duration=1000)]public async Task<ActionResult&g ...
- 理解 Javascript 的闭包
什么是闭包 闭包是什么?闭包是Closure,这是静态语言所不具有的一个新特性.但是闭包也不是什么复杂到不可理解的东西,简而言之,闭包就是: 闭包就是函数的局部变量集合,只是这些局部变量在函数返回后会 ...
- MVC form post 传值
http://www.cnblogs.com/firstcsharp/archive/2013/08/05/3238321.html @using (Html.BeginForm())参数示例 MVC ...
- 霍布森选择效应(Hobson choice Effect)
1631年,英国剑桥商人霍布森从事马匹生意,他说,你们买我的马.租我的马,随你的便,价格都便宜.霍布森的马圈大大的.马匹多多的,然而马圈只有一个小门,高头大马出不去,能出来的都是瘦马.赖马.小马,来买 ...
- PF_NETLINK应用实例NETLINK_KOBJECT_UEVENT具体实现--udev实现原理
PF_NETLINK应用实例NETLINK_KOBJECT_UEVENT具体实现--udev实现原理 相对于linux来说,udev还是一个新事物.然而,尽管它03年才出现,尽管它很低调(J),但它无 ...
- Silverlight客户端调用WCF服务难题解疑
一:解决办法 Silverlight客户端调用WCF服务在实际使用中经常会出现的问题就是无法直接应用类文件和配置文件.微软针对这一情况已经给出了解决办法.WCF开发框架可以帮助我们实现可靠性较高的跨平 ...
- Mustache.js语法学习笔记
原文地址:http://www.cnblogs.com/flypig88/archive/2012/05/14/2497780.html 看了Mustache的github,学学其中的语法,做个笔记 ...
- DataSet、DataTable、DataRow、DataColumn区别及使用实例
DataSet 表示数据在内存中的缓存. 属性 Tables 获取包含在 DataSet 中的表的集合. ds.Tables["sjxx"] DataTable 表示内存中数据的 ...
- Mysql 5.6主从同步配置与解决方案
主库IP:192.168.1.10 从库IP:192.168.1.11 centos的mysql配置文件在:/etc/my.cnf 1.主库配置编辑my.cnf: # 启用二进制日志 log_bin ...
- springmvc实现REST中的GET、POST、PUT和DELETE
spring mvc 支持REST风格的请求方法,GET.POST.PUT和DELETE四种请求方法分别代表了数据库CRUD中的select.insert.update.delete,下面演示一个简单 ...