Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

SP with For Loop in Cursor Does not get compiled without Commented CASE statement

$
0
0

I am not able to Compile following stored procedure without Commented out Case Statement (--CASE) as shown below ;  I am getting Eror as shown below if I remove this --CASE statement.

With the Commented case statement it works fine.

 

Could not execute 'CREATE PROCEDURE PKTEST ( ) AS BEGIN DECLARE SQLPlantLines_ VARCHAR(250); DECLARE SQLPlantLines ...' in 36 ms 538 µs .

SAP DBTech JDBC: [257] (at 673): sql syntax error: line 45 col 8 (at pos 673)

 

 

  

 

Could not execute 'END' in 29 ms 979 µs .

SAP DBTech JDBC: [257]: sql syntax error: incorrect syntax near "END": line 1 col 1 (at pos 1)

 

Duration of 2 statements: 66 ms

 

 

 

CREATEPROCEDURE PKTEST

(

)

AS

BEGIN

       DECLARE SQLPlantLines_ VARCHAR(250);

       DECLARE SQLPlantLines VARCHAR(8000);

        

 

       CREATELOCALTEMPORARYTABLE #T(

            SourcingLine VARCHAR(250)

            ,REGION VARCHAR(250)

         );

             

      SQLPlantLines := '';

       BEGIN  -- Cusror

              DECLARECURSOR c_Markets FORSELECT SourcingLine FROM #T ;

                  FOR C_Market_now as c_Markets Do

                   Select C_Market_now.SourcingLine into SQLPlantLines_ from dummy;

              SQLPlantLines := IFNULL(:SQLPlantLines || ',', '';

   -- CASE

                  ENDFOR;

       END;

   

 

END;


Viewing all articles
Browse latest Browse all 6412

Trending Articles



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