I have a case statement that goes a little something like this:
case @type
when "normal"
when "return"
else
end
That works fine but I want to add in something like:
case @type
when "normal"
when "return"
when @type length > 1, and contains no spaces
else
end
Is that valid / safe?
if you aren’t matching against the value of @type then don’t include it right after the case statement, but rather in the when clauses: