Quantcast
Channel: SCN: Message List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 9165

Re: Incomprehensible error message

$
0
0

Well the procedure is quite large and I don't actually want to make all our code public, it is from our current product. Meanwhile I've been experimenting with commenting parts of the procedure out and so I've identified the culprit statement. Mind you, when executed outside of the procedure, it runs fine. The "bad" statement was

 

    UPDATE vc SET a = tmp.perc FROM (
        SELECT tmp1.uu, CASE WHEN tt < :mfr THEN 0 ELSE ROUND(tt/aa*100, 0) END perc FROM (SELECT c2.uu, COUNT(*) tt FROM c c1, c c2, threat t WHERE c1.uu = t.uu AND c1.time BETWEEN :day_before AND :now AND c1.id = c2.id AND c1.ubc >= :tur AND c2.ubc >= :cur GROUP BY c2.uu) tmp1, (SELECT c1.uu, COUNT(*) aa FROM cats c1 WHERE c1.time BETWEEN :day_before AND :now AND c1.ubc >= :cur GROUP BY c1.uu) tmp2 WHERE tmp1.uu = tmp2.uu) tmp WHERE vc.uu = tmp.uu;

 

 

 

Curiously, a cosmetic change makes the procedure to execute correctly:

 

    UPDATE vc SET a = (SELECT tmp.perc FROM (
        SELECT tmp1.uu, CASE WHEN tt < :mfr THEN 0 ELSE ROUND(tt/aa*100, 0) END perc FROM (SELECT c2.uu, COUNT(*) tt FROM c c1, c c2, threat t WHERE c1.uu = t.uu AND c1.time BETWEEN :day_before AND :now AND c1.id = c2.id AND c1.ubc >= :tur AND c2.ubc >= :cur GROUP BY c2.uu) tmp1, (SELECT c1.uu, COUNT(*) aa FROM cats c1 WHERE c1.time BETWEEN :day_before AND :now AND c1.ubc >= :cur GROUP BY c1.uu) tmp2 WHERE tmp1.uu = tmp2.uu) tmp WHERE vc.uu = tmp.uu);

 

Since this has worked without problems on SP6 and the problem appeared right after upgrading to SP7, I'd suspect some malign Hana code change...In any case, it would be a lot more user-friendly if the error message were readable by humans :-)

 

-- Micha


Viewing all articles
Browse latest Browse all 9165

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>