Exp 13
Exp 13
Exp 13
Program:
SQL> DECLARE
c_id emp.id%type:=10;
c_name emp.name%type;
c_addr emp.address%type;
begin
dbms_output.put_line('Name:'||c_name);
dbms_output.put_line('Address:'||c_addr);
exception
end;
no such customer
SQL> declare
c_id emp.id%type:=30;
c_name emp.name%type;
c_addr emp.address%type;
begin
dbms_output.put_line('Name:'||c_name);
dbms_output.put_line('Address:'||c_addr);
exception
end;
Name:sai
Address:mumbai
USER DEFINED
SQL> declare
c_id emp.id%type:=&id;
c_name emp.name%type;
c_addr emp.address%type;
ex_invalid_id exception;
begin
if c_id<=0 then
raise ex_invalid_id;
else
dbms_output.put_line('address:'||c_addr);
end if;
exception
end;
SQL> /
name:sai
address:mumbai