当前位置:Gxlcms > 数据库问题 > PLSQL 美化规则文件详解

PLSQL 美化规则文件详解

时间:2021-07-01 10:21:17 帮助过:23人阅读

Version=1
RightMargin=90
Indent=4
UseTabCharacter=FALSE
TabCharacterSize=4
AlignDeclarationGroups=TRUE
AlignAssignmentGroups=TRUE
KeywordCase=1
IdentifierCase=1
UseSpecialCase=TRUE
ItemList.Format=1
ItemList.Align=TRUE
ItemList.CommaAfter=TRUE
ItemList.AtLeftMargin=FALSE
EmptyLines=1
ThenOnNewLine=FALSE
LoopOnNewLine=FALSE
DML.LeftAlignKeywords=FALSE
DML.LeftAlignItems=FALSE
DML.OnOneLineIfPossible=TRUE
DML.WhereSplitAndOr=TRUE
DML.WhereAndOrAfterExpression=FALSE
DML.WhereAndOrUnderWhere=TRUE
DML.InsertItemList.Format=1
DML.InsertItemList.Align=FALSE
DML.InsertItemList.CommaAfter=TRUE
DML.InsertItemList.AtLeftMargin=FALSE
DML.SelectItemList.Format=1
DML.SelectItemList.Align=TRUE
DML.SelectItemList.CommaAfter=TRUE
DML.SelectItemList.AtLeftMargin=FALSE
DML.UpdateItemList.Format=0
DML.UpdateItemList.Align=FALSE
DML.UpdateItemList.CommaAfter=FALSE
DML.UpdateItemList.AtLeftMargin=FALSE
ParameterDeclarationList.Format=1
ParameterDeclarationList.Align=TRUE
ParameterDeclarationList.CommaAfter=TRUE
ParameterDeclarationList.AtLeftMargin=FALSE
RecordFieldList.Format=1
RecordFieldList.Align=TRUE
RecordFieldList.CommaAfter=TRUE
RecordFieldList.AtLeftMargin=FALSE
SplitAndOr=FALSE
AndOrAfterExpression=FALSE
[SpecialCase]
技术图片

2.使用PLSQL,点击PL/SQL Developer -> tools -> Preferences -> plsql beautifier -> rules file 将之前的文件载入进来,点击应用即可

SQL美化前效果:

技术图片

 

 

美化后的效果:

 

技术图片

 

 

PS: 之前百度的时候,发现还有一个小技巧,也分享给大家

在上面DDL语句前后加上begin 和 end,哈哈,再美化下试试看,DDL被成功被美化了。

 

begin---①
create table student(
tid NUMBER(32) NOT NULL,
stu_name VARCHAR2(32),
stu_no VARCHAR2(64),
stu_sex char(1),
stu_age NUMBER(3)
);
end;--②

 

美化后的效果是:

 

BEGIN
---①
CREATE TABLE STUDENT(TID NUMBER(32) NOT NULL,
STU_NAME VARCHAR2(32),
STU_NO VARCHAR2(64),
STU_SEX CHAR(1),
STU_AGE NUMBER(3));
END; --②

 

PLSQL 美化规则文件详解

标签:详解   代码优化   select   哈哈   enc   rdf   dev   expr   begin   

人气教程排行