Print Thread
Beautifier error on 'complicated' RANKs/COUNTs/etc
#57207 10/26/17 10:38 AM
Joined: Jun 2007
Posts: 61
Sheffield
I
Member
OP Offline
Member
I
Joined: Jun 2007
Posts: 61
Sheffield
Hi,
Consider the following SQL - it's just something I knocked up to quickly demonstrate the issue :

SQL Query
SELECT LEVEL,
       dense_RANK() OVER(PARTITION BY NULL ORDER BY CASE WHEN 1 = 1 THEN 1 ELSE 2 end, MOD(LEVEL, 2)) rnk,
       COUNT(*) OVER(PARTITION BY NULL ORDER BY CASE WHEN 1 = 1 THEN 1 ELSE 2 end, MOD(LEVEL, 2)) cnt
FROM   dual
CONNECT BY LEVEL <= 100

This won't beautify.
RANKs and COUNTs (and other aggregated window functions) do beautify on the whole, but the addition of the case statement within it topples it over this time.
Is this something you could look into fixing? It's not a major issue, just more of an annoyance when trying to beautify large chunks of code and then having to figure out which bit won't.

Using Version 12.0.5.1828 (32 bit) on Windows 10 (64-bit) Build 15063

Thanks
Matt.

Re: Beautifier error on 'complicated' RANKs/COUNTs/etc
IncredibleMrT #57211 10/27/17 09:26 AM
Joined: Aug 1999
Posts: 22,232
Member
Offline
Member
Joined: Aug 1999
Posts: 22,232
The beautifier does indeed not yet support analytical functions. This is on the to-do list.


Marco Kalter
Allround Automations
Re: Beautifier error on 'complicated' RANKs/COUNTs/etc
Marco Kalter #57213 10/27/17 12:36 PM
Joined: Feb 2017
Posts: 13
Gdynia
F
Member
Offline
Member
F
Joined: Feb 2017
Posts: 13
Gdynia
Add this future to the DDL code pls.


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.034s Queries: 15 (0.008s) Memory: 2.5060 MB (Peak: 3.0405 MB) Data Comp: Off Server Time: 2024-06-16 21:47:09 UTC
Valid HTML 5 and Valid CSS