More information is needed here.
How you assign the result of a query to a variable, or how you put a message on a report, depends on the programs/platform you are using.
I hope this answers your question.
The platform is LINX. I am writing in SQL. Each time I encounter an error I am writing to an error Log table. At the end of the processing, I selecting everything from that table where the error_date is equal to the sysdate. What I wanted was when there are NO errors for that run, instead of a blank report, Iwanted to write '** NO ERRORS FOUND **.
I don't believe I am assigning a result of the query to a variable. In fact, that's 1 of the things I've been trying to do & then query the variable so that when it's 0 I can put out the message. Everything I've tried has come back with an error..
--rem creates an error report/file of those errors just identified
spool c:studentrefund.errors.from.isis.csv
DEFINE _EDITOR= pico
SET heading off
SET feedback off
SET echo off
SELECT ERROR_ID, ERROR_PIDM, ERROR_DATE, ERROR_REASON, ERROR_USER_ID
FROM error_log
WHERE ERROR_DATE LIKE TRUNC(SYSDATE);
/
commit;
spool off
--------
Thanks for clarifying this.
I think you could use another query to count the errors.
Something like this:
<pre>
-- display a message when no errors are found, or null when errors exist
SELECT decode(count(*),0,'** NO ERRORS FOUND **',null)
FROM error_log
WHERE ERROR_DATE LIKE TRUNC(SYSDATE);
-- and then the query that shows the actual errors
SELECT ERROR_ID, ERROR_PIDM, ERROR_DATE, ERROR_REASON, ERROR_USER_ID
FROM error_log
WHERE ERROR_DATE LIKE TRUNC(SYSDATE);</pre>
Hope this helps.
I’d like to thank you for the help. It’s exactly what I wanted.
Sherry
I’m glad it worked.
Best regards,