Tuesday, June 19, 2018

Example of System named Exception. (Use of “Other” Exception) - DBMS (Exception)


declare
add1 student.address %type;
sname student.name %type;
begin
sname:='&sname';
select address into add1 from student;
dbms_output.put_line('Address of the student is '||add1);
exception when Too_many_rows then
dbms_output.put_line('There are too many rows');
when others then
dbms_output.put_line('ERROR OCCURED');
dbms_output.put_line(SQLERRM);
dbms_output.put_line(SQLCODE);
end;

No comments:

Post a Comment