Re: Sqlplus HTML Report
Date: Tue, 21 Aug 2018 20:00:55 +0700
Message-ID: <CAP50yQ924-N0cGcJhqF5WOiCHof2HFgYp=KyKCiPqV=D0ibHXQ_at_mail.gmail.com>
Or just use prompt to indicate if there is no data it means there is no data - and the report didn't fail or something. E.g.:
prompt "Active session report below - if no sessions are currently active, no rows are returned:"
On Tue, Aug 21, 2018 at 5:58 PM, Mark W. Farnham <mwf_at_rsiz.com> wrote:
> A trivial solution is to union all that with selecting the correct number
> of nulls from dual, as long as you are not processing the row by row
> results.
>
>
>
> *From:* oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_
> freelists.org] *On Behalf Of *Sanjay Mishra (Redacted sender "smishra_97"
> for DMARC)
> *Sent:* Monday, August 20, 2018 8:27 PM
> *To:* Oracle-L Freelists
> *Subject:* Sqlplus HTML Report
>
>
>
> Can someone help as what I am missing in the following report.
>
>
>
> Below SQL works and create report when there are some rows but comes out
> blank when there is no rows. I want to display the title atleast in blank
> as it is sent as email. Blank email confuse as what is the report
>
>
>
>
>
> _at_htmlon
>
>
>
> spool myreport3.htm
>
> COLUMN name NEW_VALUE _instname NOPRINT
>
> select upper(name) name from v$database;
>
>
>
> Column Title Entmap off
>
> set heading on
>
> TTITLE CENTER '<h1>Daily Report : - Inactive User Session </h1>' -
>
> RIGHT 'Page:' FORMAT 999 SQL.PNO
>
>
>
> select username, sid,serial#,machine,program,*logon_time*
>
> from v$session s
>
> where username IS NOT NULL AND username NOT IN ('SYS','SYSTEM','DBSNMP')
>
> and status = 'INACTIVE'
>
> order by logon_time desc;
>
> spool off
>
> _at_htmloff
>
>
>
>
>
> Sanjay
>
-- // zztat - The Next-Gen Oracle Performance Monitoring and Reaction Framework! Visit us at zztat.net | _at_zztat_oracle | fb.me/zztat | zztat.net/blog/ -- http://www.freelists.org/webpage/oracle-lReceived on Tue Aug 21 2018 - 15:00:55 CEST