How To Raise Exception When Two Errors Occur - Oracle Errors
This is a discussion on How To Raise Exception When Two Errors Occur - Oracle Errors ; Hi This is Shiva kumar Chandramouli In this program if two errors are occurred how to raise them at a time i.e, if x size and y size both are more than length of 4 characters then how to raise ...
![]() |
| | LinkBack | Thread Tools | Display Modes |
|
#1
| |||
| |||
| This is Shiva kumar Chandramouli In this program if two errors are occurred how to raise them at a time i.e, if x size and y size both are more than length of 4 characters then how to raise the error declare x varchar2(20) := &x; y varchar2(4) := &y; z varchar2(4); p varchar2(4); x_size_err exception; y_size_err exception; xy_size_err exception; begin z := length(x); p :=length(y); if(z>4) then raise X_size_err; end if; if(p>4) then raise y_size_err; end if; if((z>4) and (p>4)) then raise xy_size_err; end if; z :=x/y; dbms_output.put_line(z); exception --case when xy_size_err then dbms_output.put_line('x size and y size error'); when x_size_err then dbms_output.put_line('size mismatch'); when y_size_err then dbms_output.put_line('y size mismatch'); when zero_divide then dbms_output.put_line('dividing with y=0 an error'); -- else -- dbms_output.put_line('check the entered values'); --end case; end; / |
![]() |
« Previous Thread
|
Next Thread »
| Thread Tools | |
| Display Modes | |
| |
All times are GMT -4. The time now is 05:55 AM.




Linear Mode