I need to recreate the output of the following script:-
break on country skip 1 compute sum of downtime on country define start_date ="trunc((get_date('MONTH','START') - 1),'MONTH') + 1 +2/24" define end_date="trunc(trunc(get_date('MONTH','START'),'MONTH'),'DD')+ + 12/24" define percent="((1 - (sum(NVL(ncl.downtime_secs,0))/sum(date_seconds_ +between(&end_date,&start_date)))) * 100)" spool ${spool_file} set markup html on spool on select sd.site_name, sum(NVL(ncl.downtime_secs,0)) downtime, (case when &percent < 100 then to_char(&percent,99.99999) else to_ +char(&percent,999) end) availability, convert_seconds_to_dhms(sum(NVL(ncl.downtime_secs,0))) downtime_dh +ms from ncl_summary_tmp ncl, (select distinct contracted_node_name, site_name from contracted_n +odes ) cn, site_details sd where UPPER(SUBSTR(ncl.node (+) ,0,(INSTR(ncl.node (+),'.') -1))) = +cn.contracted_node_name and sd.site_name = cn.site_name having &percent < 100 group by sd.site_name order by downtime
The substitution variables I can live without - they just improve code readability. The break and computes I need for the layout of the report

In reply to Re: Re: Sqlplus -> DBD::Oracle Question by set_uk
in thread Sqlplus -> DBD::Oracle Question by set_uk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.