Hi Eshan,
in your example you simply remove the COMMITs and the WHEN OTHERS THEN ROLLBACK, because any error automatically rolls back.
Of course you can simply avoid the division-by-zero error:
SELECT price / NULLIF(earnings,0) INTO pe_ratio FROM stocks
Dieter
↧