You have a bug, this stored procedure has legal text, you can compile it, but it cannot be edited by the tool.
You can compile this stored procedure but you cannot edit with your tool, it says that the code is wrong, but it is not.
CREATE DEFINER = 'root'@'%'
PROCEDURE simulation.comparebill()
BEGIN
with mybill AS(
with billing AS(select c.day AS day,c.code AS code,cast(c.seconds as double) / 60.00 AS Mins,
case when r.code is null then 0.005 when c.jurisdiction = 'Inter' THEN
r.inter when c.jurisdiction = 'Intra' then r.intra else greatest(r.intra,r.inter) end AS rate,
ifnull(r.description,'Missing Destinations at $0.005') AS description
from (cdr c INNER join ratedeck r on(c.code = r.code))) select billing.day AS day,billing.description AS description,
round(sum(billing.Mins),2) AS Minutes,
round(sum(billing.Mins * billing.rate),2) AS Total
from billing group by billing.day,billing.description WITH ROLLUP)
select ifnull(mybill.day,'') AS DAY,ifnull(mybill.description,'') AS DESCRIPTION,
lpad(format(mybill.Minutes,2,10),14,' ') AS Minutes,
lpad(concat('US$ ',format(mybill.Total,2)),14,' ') AS Total FROM mybill
WHERE description IS NOT NULL OR day is null
ORDER BY day DESC;
END
-
AdminDevart (_, Devart) commented
Dear User,
Thanks for your patience!
We would like to inform you that a new version of the Studio has now been released, it includes a lot of features and fixes, including the issue you described.
We kindly ask you to update to the latest version of the Studio and check the implementation of the functionality you described in this post. If the issue is still relevant, please let us know in detail by filling out the form on the company’s website (https://www.devart.com/company/contactform.html) or write directly to support@devart.com
Best,
Devart Team