Ans
Ans
If the
handling.
6M
Ans
DECLARE
c_id numeric(10);
invalid_id_Exception Exception;
BEGIN
c_id:=&c_id;
if(c_id<0) then
raise invalid_id_Exception;
end if;
EXCEPTION
END;
Ans
declare
n number;
i number;
rev number:=0;
r number;
begin
n:=&n;
while n>0
loop
r:=mod(n,10);
rev:=(rev*10)+r;
n:=trunc(n/10);
end loop;
dbms_output.put_line('reverse is '||rev);
end;
6M
Ans
Emp table or not. Accept empno from user. If employee does not exist
Ans
PL/SQL Program:
declare
no emp.empno%type;
begin
no:=&no;
exception
end;
21. Implicit Cursor Example:
Create customers table and have records. update the table and increase
salary of each customer by 5000
ans
DECLARE
total_rows number(2);
BEGIN
UPDATE customers
IF sql%notfound THEN
total_rows := sql%rowcount;
END IF;
END;
Ans
DECLARE
c_id customers.id%type;
c_name customers.name%type;
c_addr customers.address%type;
CURSOR c_customers is
BEGIN
OPEN c_customers;
LOOP
END LOOP;
CLOSE c_customers;
END;
100000
as
select ACC_No,PAN
from Depositor