Hello Umesh,
in front of the where clause a blank is missing to separate the value set in the column from the word "where" (-> ... || ' where WID = ' || :R."W1";).
In case your column types are character based you should also enclose the values in single quotes.
Regards,
Florian