Oracle SQL, PLSQL, APEX How To's by Dr. S. Raghunathan - HTML preview

PLEASE NOTE: This is an HTML preview only and some elements such as links or page numbers may be incorrect.
Download the book in PDF, ePub, Kindle for a complete version.

cursor cursorl is select distinct account_head, account_type from account_head_master

order by account_head;

 

cursor_val cursorl%ROWTYPE;

 

begin

 

open cursorl;

 

loop

 

fetch cursorl into cursor_val;

 

exit when cursorl%NOTFOUND;

 

case

 

when cursor_val.account_type = 'CAPITAL' then dbms_output.put_line(cursor_val.account_head II ' is accounted

in balance sheet');

 

when cursor_val.account_type = 'REVENUE' then dbms_output.put_line(cursor_val.account_head II ' is accounted

in Profit and Loss Account');

 

end case;

 

end loop;

 

close cursorl; end OUTPUT/RESULT:

CASH ACCOUNT is accounted in balance sheet

 

DEPRECIATION is accounted in Profit and Loss Account DISCOUNTS is accounted in Profit and Loss Account EXPENSES is accounted in Profit and Loss Account FIXED ASSET is accounted in balance sheet