create or replace procedure xx IS
msql varchar2(200);
begin
--loop
msql :=
q'[SELECT ename,
sal,
CASE
WHEN sal <= 2000 THEN
'过低'
WHEN sal >= 4000 THEN
'过高'
ELSE
'OK'
END AS status
FROM emp]' ;
execute immediate msql;
--end loop;
end;