I have a daily RMAN report that I send to myself and I wanted to color code the duration of the backup… for instance, backups taking less than 100 minutes were green, between 100 and 300 minutes, orange, over that red.
Currently, I’m using the following to format the column in the HTML output:
column “B/Up Duration in mins” ON HEADING ‘B/Up Duration!in mins’ format 999.99
Well, that works fine until I put that column into a CASE statement. It still splits the heading on two lines but no longer gives me the number format I wanted. Also, I needed to alias the column so the column formatting would take affect… to get around the two problems, here’s what I did. First, I format the column within the CASE statement and then put the alias at the end of the CASE statement as seen below:
WHEN elapsed_seconds/60 < 100 then
WHEN elapsed_seconds/60 between 100 and 300 then
END as “B/Up Duration in mins”