create table person
(p_no number(10) primary key,p_name varchar(15) not null,p_addr varchar(15));
insert into pers values(1,'Abhi','pimpri');
insert into pers values(2,'Ajay','pune');
create table investment
(inv_no number(10) primary key,inv_name varchar(15) not null,inv_date date,inv_amt number(10),p_no number(10) references person,check(inv_amt>10000));
insert into investment values(101,'Ajay','21-DEC-2001',20000,1);
insert into investment values(102,'Vijay','21-DEC-2002',20000,2);
Q1)
create or replace procedure p1(dt in date)
as
cursor c1 is select p.p_no,p.p_name,p.p_addr from person1 p,investment1 i
where p.p_no=i.p_no and inv_date=dt;
begin
for x in c1 loop
dbms_output.put_line(x.p_no||' '||x.p_name||' '||x.p_addr);
end loop;
end;
declare
begin
p1('21-dec-2001');
end;
Q2)
create or replace trigger t8
before insert or update on investment
for each row
Begin
if(:new.inv_date < sysdate) then
raise_application_error(-20001,'inv_date should be greater than sysdate');
End if;
End;
Recent Posts
Posted on 2019-07-18
Posted on 2019-07-18
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-05-28
Posted on 2019-05-24
Posted on 2019-05-24
Posted on 2019-05-23
Posted on 2019-05-23
Posted on 2019-05-23
Posted on 2019-05-23
Posted on 2019-05-23
Posted on 2019-05-23
Posted on 2019-05-23
Posted on 2019-05-23
Posted on 2019-05-23