Beautifier and quotes .. v14b8

rbrooker

Member³
Morning,

Seems like the issue with quotes has reappeared in v14b8 ...

Code:
-- # -----------------------------------------
            WHEN 'spotlight-tablespace' THEN
                SELECT db_name
                INTO v_db
                FROM db_database
                WHERE id_db = pi_argument1;

                dbms_lob.append(v_data, q'[
SELECT CASE nvl(b.monitor_type, '-')
           WHEN '-' THEN
            'Not Monitored'
           ELSE
            CASE b.monitor_type
                WHEN 'P' THEN
                 'Monitored - %'
                WHEN 'G' THEN
                 'Monitored - GB'
                ELSE
                 'Monitored - Unknown'
            END
       END tablespace_monitored
      ,a.tablespace_name
      ,(a.block_size / 1024) || 'K' block_size
      ,a.tablespace_gb
      ,a.segment_gb
      ,round(a.segment_gb / a.tablespace_gb * 100, 3) tablespace_pcnt
      ,a.tablespace_gb - a.segment_gb tablespace_remaininggb
      ,CASE nvl(b.monitor_type, '-')
           WHEN '-' THEN
            NULL
           ELSE
            CASE b.monitor_type
                WHEN 'P' THEN
                 to_char(b.monitor_threshold) || '% ( ' || to_char(round(a.tablespace_gb * (b.monitor_threshold/100), 3), '999999990.000') || 'G )'
                WHEN 'G' THEN
                 to_char(b.monitor_threshold) || 'G'
            END
       END tablespace_threshold
FROM (SELECT a.tablespace_name
            ,a.block_size
            ,COUNT(b.file_id) tablespace_files
            ,round(SUM(CASE b.autoextensible
                           WHEN 'YES' THEN
                            b.maxbytes
                           ELSE
                            b.bytes
                       END) / power(1024, 3), 3) tablespace_gb
            ,nvl(round(c.bytes / power(1024, 3), 3), 0) segment_gb
      FROM dba_tablespaces@]' || v_db || q'[ a
      INNER JOIN dba_data_files@]' || v_db || q'[ b
      ON (a.tablespace_name = b.tablespace_name)
      LEFT OUTER JOIN (SELECT tablespace_name
                            ,SUM(bytes) bytes
                      FROM dba_segments@]' || v_db || q'[
                      GROUP BY tablespace_name) c
      ON (a.tablespace_name = c.tablespace_name)
      WHERE a.contents = 'PERMANENT'
      GROUP BY a.tablespace_name
              ,a.block_size
              ,c.bytes) a
LEFT OUTER JOIN monitor_tablespace b
ON (b.id_db = ]' || pi_argument1 || q'[ AND a.tablespace_name = b.tablespace_name)
ORDER BY tablespace_monitored
        ,tablespace_pcnt DESC
]');

the final quote on line 34 of the example causes the syntax highlighting of the string to finish whereas if you put a space between the ) and the ', the highlighting continues...

cheers,
rich.
 
It seems to work just fine for me. Can you send a screenshot of the correct and incorrect situation to support@allroundautomations.com?

This is the line you are referring to?

to_char(b.monitor_threshold) || '% ( ' || to_char(round(a.tablespace_gb * (b.monitor_threshold/100), 3), '999999990.000') || 'G )'
 
Morning Marco,

I have emailed those through and also the contents of my .br file in case that helps.

cheers `:)
 
Back
Top