Tuesday, June 19, 2018

Write a pl/sql code to retrieve the data from student table whose sr.no is 02ce33. If data not found then show the message “data not found“ (Use EXCEPTION in pl/sql code) - DBMS (Exception)

declare
Srno student.sr_no %type;
sname student.name %type;
begin
dbms_output.put_line('Enter value for srno: ');
Srno:='&srno';
select name into sname from student where sr_no=srno;
dbms_output.put_line('The name of student is '||sname);
exception when no_data_found then
dbms_output.put_line('The Data does not exist');
end;

No comments:

Post a Comment