Quantcast
Channel: SCN: Message List - SAP Adaptive Server Enterprise (SAP ASE) for Custom Applications
Viewing all articles
Browse latest Browse all 3587

I must be using CASE statement wrong, but...how?

$
0
0

I'm getting an error on this code segment: An unexpected token "CASE" was found.  Expected "end".  Yet I thought this is how you code a CASE statement:

 

DECLARE @loop_var INT

 

SET @loop_var = 0

 

WHILE 1=1

BEGIN

    SET @loop_var = @loop_var + 1

 

    CASE @loop_var

    WHEN 0 THEN

        SELECT "0"

         BREAK

    WHEN 1 THEN

        SELECT "1"

     BREAK

    WHEN 2 THEN

        SELECT "2"

     BREAK

    END CASE

END


Viewing all articles
Browse latest Browse all 3587

Trending Articles



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