CURSOR and CASE STATEMENT
452641Sep 16 2005 — edited Oct 9 2007Hello All:
Is it possible to have the CASE Statement in the cursor? If so, could you please show me how to use it? I tried to use it as following but it did not work on Form Builder. I tried it on Oracle SQL *Plus and it worked there.
CURSOR tbl_chck_cur IS
SELECT chck_id,
NVL(sup_chck_id,'') sup_chck_id,
(CASE WHEN sup_chck_id = null THEN
(SELECT order_no from tbl_chck_lk where tbl_chck.chck_id = tbl_chck_lk.chck_id ) ELSE
(SELECT order_no from tbl_chck_lk
where tbl_chck.chck_id = tbl_chck_lk.chck_id ) END) order_no,
....
....
....
FROM tbl_chck;
Thanks in advance for any help.
KT