 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
[SA 7.1.246 Pro] - FR: assignment alignment |
|
Would it be possible to align THEN parts of CASE statements as well? They are kind of assignments, after all.
|
|
Thu Jan 29, 2015 6:55 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
Could you please provide a sample of the desired result?
|
|
Thu Jan 29, 2015 10:11 am |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
Sure. With my current formatting rules for CASE being
 |
 |
CASE ...
WHEN ...
AND ...
OR ... THEN ...
ELSE ...
END
|
an arbitrary CASE code gets formatted as:
 |
 |
SELECT
CASE
WHEN s.DiszpState IN (1 ,2)
AND s.GkVez = 9 THEN DATEDIFF(MINUTE ,s.Indulas ,s.Erkezes)
WHEN s.DiszpState = 0 THEN DATEDIFF(minute ,s.IrIndulas ,s.IrErkezes)
WHEN s.GkVez = 8
OR s.FeladatId = 9
OR s.Menetido = 13 THEN DATEDIFF(minute ,s.IrErkezes ,s.IrIndulas)
ELSE 0
END AS col1
.
.
.
|
If it could be formatted like
 |
 |
SELECT
CASE
WHEN s.DiszpState IN (1 ,2)
AND s.GkVez = 9 THEN DATEDIFF(MINUTE ,s.Indulas ,s.Erkezes)
WHEN s.DiszpState = 0 THEN DATEDIFF(minute ,s.IrIndulas ,s.IrErkezes)
WHEN s.GkVez = 8
OR s.FeladatId = 9
OR s.Menetido = 13 THEN DATEDIFF(minute ,s.IrErkezes ,s.IrIndulas)
ELSE 0
END AS col1
.
.
.
|
it would enhance readability of the code.
|
|
Fri Jan 30, 2015 7:22 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
Thank you. I have entered a new enhancement request for this feature.
|
|
Mon Feb 02, 2015 11:12 am |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|