Hello Vijeesh,
you are getting the error messages, because you are trying to execute SQLScript code within the SQL console. That is not possible in a direct way. SQLScript coding has to be implemented in a procedure or a function.
If you have a SPS10 system (or higher) you can use for testing reasons anonymous blocks in the SQL console to execute SQLScript coding. For instance (I changed your coding to use the DUMMY column of the DUMMY table; but of course it works also with your artifacts in case they exist):
do begin DECLARE WHSList varchar(5000); SELECT COALESCE(:WHSList || ',', '') || '"' || "DUMMY" || '"' INTO WHSList FROM DUMMY; select :WHSList from DUMMY; end;
Regards,
Florian