Case Syntax Does not work in Test Window

Covina

Member²
Check this out.
Case does not work in Test Window:

DECLARE

CURSOR cur IS
SELECT
(CASE
WHEN (nvl(ret_ee,
0) = 0 AND nvl(ret_er,
0) = 0) THEN
'Teachers and State Employees Retirement System'
ELSE
NULL
END) tse_ret1
,(CASE
WHEN (nvl(ret_ee,
0) = 0 AND nvl(ret_er,
0) = 0) THEN
'http://www.treasurer.state.us'
ELSE
NULL
END) tse_ret2
,(CASE
WHEN (nvl(ret_ee,
0) = 0 AND nvl(ret_er,
0) = 0) THEN
'Retirement Planning:'
ELSE
NULL
END) tse_ret3
FROM my_tab w
WHERE person_id = 12345;

BEGIN

FOR rec IN cur LOOP
NULL;
END LOOP;

EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line(substr(SQLERRM,1,200));

END;
 
Works fine for me (though I had to make some changes because I do not have your "my_tab" table). What exactly goes wrong?
 
Back
Top