SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
[SA 7.1.246 Pro] - FR: assignment alignment

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
[SA 7.1.246 Pro] - FR: assignment alignment
Author Message
gemisigo



Joined: 11 Mar 2010
Posts: 1404

Post [SA 7.1.246 Pro] - FR: assignment alignment Reply with quote
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6515

Post Reply with quote
Could you please provide a sample of the desired result?
Thu Jan 29, 2015 10:11 am View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 1404

Post Reply with quote
Sure. With my current formatting rules for CASE being
Code:

CASE ...
   WHEN  ...
     AND ...
     OR  ...  THEN  ...      
   ELSE  ...
END

an arbitrary CASE code gets formatted as:
Code:

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
Code:

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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6515

Post Reply with quote
Thank you. I have entered a new enhancement request for this feature.
Mon Feb 02, 2015 11:12 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
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


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.