MySQL Forums
Forum List  »  Newbie

Mysql query should force the report to fail or throw an error!!!!
Posted by: VENKATA KORR
Date: February 28, 2011 03:58PM

I'm a BO developer and I'm trying to create a sql statement in Mysql which should return error when there is no data in yesterday's file.
Below is the query. This query returns null when I added the case statement above the main query and my report runs nothing which should force to fail. I digged many forums and found that 1/0 gives NULL in Mysql and so ended with dead-ends. Could any one plz help me out with this issue.

select
case
when count(*) = 0
then (1/0)
else 1
end
from
(select ...

... where current_date, interval 1 day)
)



Edited 2 time(s). Last edit at 02/28/2011 04:01PM by VENKATA KORR.

Options: ReplyQuote


Subject
Written By
Posted
Mysql query should force the report to fail or throw an error!!!!
February 28, 2011 03:58PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.