Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Interactive grid removes spaces

Look at the query and result generated in sqlplus :

SELECT 
  plan_line_id,
  LPAD (a.plan_operation || ' ' || a.plan_options,
        LENGTH (a.plan_operation || ' ' || a.plan_options) + a.plan_depth * 3
       ) OPERATION,
  a.plan_cost COST,
  output_rows "ROWS"
FROM gV$SQL_PLAN_MONITOR a
WHERE sql_id = '8gan9d0z7bzhm'

enter image description here

Looks pretty cool doesn’t it 😉

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

And the same result in grid report :

enter image description here

Apex 21 removes all spaces generated by lpad function. The same problem is with classic report and classic grid 🙁 any idea why ?

>Solution :

You’ll have to use a character which can be correctly interpreted by your browser – instead of a space, use a non-breaking space, the &nbsp character.

Something like this (I’m using the # character in the CTE, which is then replaced by  :

WITH
   temp
   AS
      (SELECT plan_line_id,
              LPAD (
                 a.plan_operation || ' ' || a.plan_options,
                   LENGTH (a.plan_operation || ' ' || a.plan_options)
                 + a.plan_depth * 3,
                 '#') OPERATION,                       --> here
              a.plan_cost COST,
              output_rows "ROWS"
         FROM a1_test a
        WHERE     sql_id = '9p4xcx2gd8u49')
SELECT plan_line_id,
       REPLACE (operation, '#', ' ') operation,   --> here
       cost,
       "ROWS"
  FROM temp

Turn "Operation" column’s **Escape special characters" property OFF.

The result is then

enter image description here

Not as pretty as you’d want it to, but it is better than what you currently have.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading