Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8581

SAP DBTech JDBC: [1299]: no data found in calculation view

$
0
0

Dear friends,

         I create a calculation view with this SQL statement, but when I execute the follow SQL statement, it will have this exception:1299

         I know because it have no record to return, but this is the normal situation, When there is no record I want to return 0.

 

WHILE :v_round <= 38 DO

 

     SELECT COUNT(*) INTO v_c_1

     FROM :var_sub

     WHERE "LEAGUE"  = I_LEAGUE

     AND   "SEASON"  = I_SEASON

     AND   "A_ROUND" = v_round

     AND   "RESULT"  = 'F'

     GROUP BY "LEAGUE","SEASON","A_ROUND","RESULT";

END WHILE

QQ截图20150719181839.png

 

I try EXIT HANDLER  AS this, but it still have the exception, how do I handle this exception, I just want it return 0.

 

BEGIN    

     DECLARE EXIT HANDLER FOR SQL_ERROR_CODE 1299 v_c_1 := 0;

             

     SELECT COUNT(*) INTO v_c_1

     FROM :var_sub

     WHERE "LEAGUE"  = I_LEAGUE

     AND   "SEASON"  = I_SEASON

     AND   "A_ROUND" = v_round

     AND   "RESULT"  = 'F'

     GROUP BY "LEAGUE","SEASON","A_ROUND","RESULT";

    

     END;

 

Best Regards

Zhang


Viewing all articles
Browse latest Browse all 8581

Trending Articles



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