Print Thread
PL/SQL Beautifier
#65742 06/18/24 08:28 AM
Joined: Aug 2022
Posts: 7
R
raam94 Offline OP
Member
OP Offline
Member
R
Joined: Aug 2022
Posts: 7
Hi All,
I would like to understand how to format correctly the CASE Expression with PL/SQL Beautifier.
Now when I use it, I have this behaviour:
CASE
WHEN ... THEN
1
WHEN .... THEN
2
I would like to have the value after then in single row:
CASE
WHEN ... THEN 1
WHEN .... THEN 2
I tried to change the files rules many time without success.
Can anyone help me?

Thank you very much

Re: PL/SQL Beautifier
raam94 #65744 06/19/24 08:20 AM
Joined: Aug 1999
Posts: 22,280
Member
Offline
Member
Joined: Aug 1999
Posts: 22,280
Can you include the complete statement?


Marco Kalter
Allround Automations
Re: PL/SQL Beautifier
Marco Kalter #65749 06/20/24 09:48 AM
Joined: Aug 2022
Posts: 7
R
raam94 Offline OP
Member
OP Offline
Member
R
Joined: Aug 2022
Posts: 7
Originally Posted by Marco Kalter
Can you include the complete statement?
Sure, thanks

Version=1
RightMargin=200
Indent=3
UseTabCharacter=FALSE
TabCharacterSize=2
AlignDeclarationGroups=TRUE
AlignAssignmentGroups=TRUE
KeywordCase=1
IdentifierCase=2
UseSpecialCase=TRUE
ItemList.Format=1
ItemList.Align=TRUE
ItemList.CommaAfter=TRUE
ItemList.AtLeftMargin=FALSE
EmptyLines=1
ThenOnNewLine=FALSE
LoopOnNewLine=TRUE
DML.LeftAlignKeywords=FALSE
DML.LeftAlignItems=FALSE
DML.OnOneLineIfPossible=TRUE
DML.WhereSplitAndOr=TRUE
DML.WhereAndOrAfterExpression=FALSE
DML.WhereAndOrUnderWhere=TRUE
DML.JoinSplitBeforeOn=TRUE
DML.InsertItemList.Format=2
DML.InsertItemList.Align=FALSE
DML.InsertItemList.CommaAfter=TRUE
DML.InsertItemList.AtLeftMargin=FALSE
DML.SelectItemList.Format=2
DML.SelectItemList.Align=TRUE
DML.SelectItemList.CommaAfter=TRUE
DML.SelectItemList.AtLeftMargin=FALSE
DML.UpdateItemList.Format=2
DML.UpdateItemList.Align=TRUE
DML.UpdateItemList.CommaAfter=TRUE
DML.UpdateItemList.AtLeftMargin=FALSE
ParameterDeclarationList.Format=2
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]
ThenValueOnSameLine=TRUE

Re: PL/SQL Beautifier
raam94 #65750 06/21/24 08:42 AM
Joined: Aug 1999
Posts: 22,280
Member
Offline
Member
Joined: Aug 1999
Posts: 22,280
I meant the complete SQL or PL/SQL statement with the case expression.


Marco Kalter
Allround Automations
Re: PL/SQL Beautifier
Marco Kalter #65751 06/21/24 09:41 AM
Joined: Aug 2022
Posts: 7
R
raam94 Offline OP
Member
OP Offline
Member
R
Joined: Aug 2022
Posts: 7
SELECT

CASE
WHEN caus = 11 THEN 1
WHEN caus = 12 THEN 2
ELSE caus END caus ,
SUM(numero) numero,
SUM(importo) importo
FROM TAB

Re: PL/SQL Beautifier
raam94 #65754 06/24/24 09:22 AM
Joined: Aug 1999
Posts: 22,280
Member
Offline
Member
Joined: Aug 1999
Posts: 22,280
This is indeed not possible. The beautifier will place each case on a separately indented line. I have added this to the list of enhancement requests.


Marco Kalter
Allround Automations

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.023s Queries: 14 (0.009s) Memory: 2.5202 MB (Peak: 3.0396 MB) Data Comp: Off Server Time: 2024-09-16 02:47:09 UTC
Valid HTML 5 and Valid CSS