PLSQL的注释技巧
概述
正文
1. 不要在最上面写注释
/*
名字解析:案事件-文书相关-为换押证生成文书字号。
这个过程是对ASJ_GENHYZWORD的一次重构。
*/
create or replace procedure asj_ws_generateWordMarkForHYZ(in_writid in varchar2, -- 文书实例编号
in_increment in integer, -- 增量,在一书多人时需要同时为多个文书生成序列号
out_wordofwrit out varchar2, -- 文书字
out_markofwrit out integer -- 文书号
) is
编译,关掉当前窗口,重新打开这个过程,你会发现是这样子的:

2. 如何强制格式化在某处换行
create or replace procedure asj_ws_generateWordMarkForHYZ
(in_writid in varchar2, -- 文书实例编号
in_increment in integer, -- 增量,在一书多人时需要同时为多个文书生成序列号
out_wordofwrit out varchar2, -- 文书字
out_markofwrit out integer -- 文书号
) is
但是PL/SQL格式化之后,又会变成这样子:
create or replace procedure asj_ws_generateWordMarkForHYZ(in_writid in varchar2, -- 文书实例编号
in_increment in integer, -- 增量,在一书多人时需要同时为多个文书生成序列号
out_wordofwrit out varchar2, -- 文书字
out_markofwrit out integer -- 文书号
) is
此时,我们可以使用注释来强制换行:
create or replace procedure asj_ws_generateWordMarkForHYZ --
(in_writid in varchar2, -- 文书实例编号
in_increment in integer, -- 增量,在一书多人时需要同时为多个文书生成序列号
out_wordofwrit out varchar2, -- 文书字
out_markofwrit out integer -- 文书号
) is
这样,即使格式化,也不会违背我们的换行意愿了。另外,多行注释也可以实现。
select ajbh, ajmc
into ajbh, ajmc
from b_asj_aj
where rownum = 1;
但是PL/SQL的格式化会认为没有必要,而将其缩减到一行:
select ajbh, ajmc into ajbh, ajmc from b_asj_aj where rownum = 1;
你可以这样写:
select ajbh, ajmc --
into ajbh, ajmc --
from b_asj_aj --
where rownum = 1;
3. 概要内容在is关键词之前
create or replace procedure asj_ws_generateWordMarkForHYZ
/*
名字解析:案事件-文书相关-为换押证生成文书字号。
这个过程是对ASJ_GENHYZWORD的一次重构。
*/
(in_writid in varchar2, -- 文书实例编号
in_increment in integer, -- 增量,在一书多人时需要同时为多个文书生成序列号
out_wordofwrit out varchar2, -- 文书字
out_markofwrit out integer -- 文书号
) is
这样写的好处有几点:1. 我们在合适的位置加入了对于这个过程的说明,而且在概要中将显示这些内容;2. 我们对于换行的控制,会控制概要悬浮框的长度。

PLSQL的注释技巧的更多相关文章
- plsql developer 使用技巧
plsql developer 使用技巧 Oracle数据库相信已成为很多企业构建自身关键业务的重要后台支撑,也是众多开发人员常常采用的后台.但Oracle自己提供的一套客户端工具不是很好用,极大的影 ...
- 应用PLSQL Developer(技巧)
以下是一些 PLSQL Developer的使用技巧. 转自:PLSQL developer常用技巧,作者:逍遥游xj
- PLSQL Developer使用技巧整理(转)
一.工具-首选项-用户界面-编辑器-其它-显示行号二.工具-首选项-窗口类型-SQL窗口-显示隔号(行号) 在使用PL/SQL Developer对Procedure进行Debug时,突然发现无法Se ...
- PLSQL Developer使用技巧
本文由liuyk80贡献 ·PL/SQL Developer 使用技巧 1.PL/SQL Developer 记住登陆密码 在使用 PL/SQL Developer 时,为了工作方便希望 PL/SQL ...
- plsql只有注释显示问号,其余中文可以正常显示
在plsql客户端查看表信息,注释均为乱码,使用select 查询字段中中文字符正常,以下为解决方案: 1.使用语句 select * from V$NLS_PARAMETERS 查询 nls_lan ...
- PLSQL Developer使用技巧整理
Shortcut: =============================================================================== Edit/Und ...
- 转载:PLSQL Developer使用技巧整理
Shortcut(快捷方式): Edit/Undo Ctrl+Z Edit/Redo Shift+Ctrl+Z Edit/PL/SQL Beautifier Ctrl+W (自定 ...
- PLSQL性能优化技巧
1.理解执行计划1-1.什么是执行计划 oracle数据库在执行sql语句时,oracle的优化器会根据一定的规则确定sql语句的执行路径,以确保sql语句能以最优性能执行.在oracle数据库系统中 ...
- PLSQL developer常用技巧
1.PL/SQL Developer记住登陆密码 在使用PL/SQL Developer时,为了工作方便希望PL/SQL Developer记住登录Oracle的用户名和密码: 设置方法:tools- ...
随机推荐
- Codeforces 713C Sonya and Problem Wihtout a Legend DP
C. Sonya and Problem Wihtout a Legend time limit per test 5 seconds memory limit per test 256 megaby ...
- 使用awk批量杀进程的命令
在做系统运维的过程中,有时候会碰到需要杀掉某一类进程的时候,如何批量杀掉这些进程,使用awk命令是很好的选择. ps -ef|grep aaa|grep -v grep|awk '{print &qu ...
- 小程序_RSA加密功能
这是开发的第三个小程序,基于一个物流系统,简化功能开发下单流程.登录的时候,系统是使用RSA进行加解密的. 流程:第一个接口获取到后端传过来的密匙共钥(publicKey),通过公钥使用RSA加密密码 ...
- ew做socks5代理
这个工具和之前讲过的xxoo类似.链接:https://www.cnblogs.com/nul1/p/8883271.html https://zhuanlan.zhihu.com/p/3282215 ...
- 【Python学习】matplotlib的颜色
matplotlib自带的颜色 seaborn的颜色 装了seaborn扩展的话,在字典seaborn.xkcd_rgb中包含所有的xkcd crowdsourced color names. 使用的 ...
- 【设计模式】原型模式(Prototype)
摘要: 1.本文将详细介绍原型模式的原理和实际代码中特别是Android系统代码中的应用. 纲要: 1. 引入原型模式 2. 原型模式的概念及优缺点介绍 3. 原型模式对拷贝的使用 4. 原型模式在A ...
- Development tools[重点]
Development tools yum groupinfo "Development tools" Loaded plugins: product-id, security, ...
- SqlServer存储过程中使用事务,示例
create proc pro_GetProTrans @GoodsId int, @Number int, @StockPrice money, @SupplierId int, @EmpId in ...
- 006 Java并发编程wait、notify、notifyAll和Condition
原文https://www.cnblogs.com/dolphin0520/p/3920385.html#4182690 Java并发编程:线程间协作的两种方式:wait.notify.notifyA ...
- Oracle 获取ddl语句
--得到所有表空间的ddl语句 SELECT DBMS_METADATA.GET_DDL('TABLESPACE', TS.tablespace_name)FROM DBA_TABLESPACES T ...