cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SQLSCRIPT: sql syntax error: incorrect syntax near "AS"

nathan23
Explorer
0 Likes
5,830
Hi 
CASE WHEN (inTab."/BIC/C55CONTID" is NOT null) 
               THEN      
               CASE WHEN (inTab."/BIC/CRCBECFVN" >1 ) THEN
                    (SELECT "/BIC/K5SCDCEC" FROM "/BIC/AZD_TVOG2"  WHERE "/BIC/AZD_TVOG2"."/BIC/CRCBECFVN" = 1) AS "/BIC/K5SCDCEC",
                 ELSE 
                   "/BIC/K5SCDCEC" AS "/BIC/K5SCDCEC"
                   END
				   END

after writing this logic gives me an error on the AS, can you tell me the reason?

View Entire Topic
Vitaliy-R
Developer Advocate
Developer Advocate

If I got it right, you should use AS in a different place of the code. But I have not checked it on my instance.

CASE WHEN (inTab."/BIC/C55CONTID" is NOT null) 
               THEN      
               CASE WHEN (inTab."/BIC/CRCBECFVN" >1 ) THEN
                    (SELECT "/BIC/K5SCDCEC" AS "/BIC/K5SCDCEC" FROM "/BIC/AZD_TVOG2" WHERE "/BIC/AZD_TVOG2"."/BIC/CRCBECFVN" = 1) ,
                 ELSE 
                   "/BIC/K5SCDCEC" AS "/BIC/K5SCDCEC"
                   END
				   END

Regards.