Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> convert empty table to a message

convert empty table to a message

From: Helen rwulfjeq <lannyue_at_yahoo.com>
Date: Wed, 27 Jun 2001 15:22:36 -0700
Message-ID: <F001.0033B04F.20010627145018@fatcity.com>


Hello,
I have a file to contain info about the reports detailed info (stored in a temp table in the DB) we created every night. Such as: report ID, report_name...  However, sometimes there is no report generated overnight. In this case, the temp table would be empty. But this file will still spool out anyway for user to review the information about the report request. My question is: When the table is empty, is there a way that I can convert the empty lines in the file like "no report generated".  I tried DECODE, but doesnot work because there is no row return from the table. spool ...SELECT  RPAD(RTRIM(LTRIM(V$DATABASE.NAME))||'_'||  DECODE(C_REPORT_ID.REP_FILE_NAME, NULL, 'NO REPORT CREATED', ' ', 'NO REPORT CREATED'), 30), DECODE (C_REPORT_ID.REPORT_ID, NULL, 'NO REPORT CREATED', ' ', 'NO REPORT CREATED'), NAME, ADDRESS, FLOOR, ROOMFROM    VW.C_EXPORT_CYCLE, C_REPORT_ID, V$DATABASEWHERE   C_REPORT_ID.REPORT_ID = C_EXPORT_CYCLE.REPORT_ID;spool off Do you have any suggestions?
Thanks in advance
HelenDo You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 a year!http://personal.mail.yahoo.com/ Received on Wed Jun 27 2001 - 17:22:36 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US