You are on page 1of 1

create or replace procedure Registrar_Material

(a in material.id_material%type,b in material.descripcion%type,
c in material.categoria%type,d in material.año%type)
is
cant number;
begin
cant:=0;
select count(*) into cant from material where id_material = a;

if cant=0 then
insert into material values (a,b,c,d);
end if;

exception
when others then dbms_output.put_line('Error algo salió mal');
end;

create or replace procedure Registrar_designamiento


(a in designamiento.id_ambiente%type,b in designamiento.id_material%type,
c in designamiento.cantidad%type,d in designamiento.estado%type)
is
cant number;
begin
cant:=0;
select count(*) into cant from designamiento where id_ambiente = a;

if cant=0 then
insert into designamiento values (a,b,c,d);
end if;

exception
when others then dbms_output.put_line('Error algo salió mal');
end;

create or replace procedure Registrar_ambientes


(a in ambientes.id_ambiente%type,b in ambientes.nombre%type,
c in ambientes.dimensiones%type,d in ambientes.cat_ambiente%type)
is
cant number;
begin
cant:=0;
select count(*) into cant from ambientes where id_ambiente = a;

if cant=0 then
insert into ambientes values (a,b,c,d);
end if;

exception
when others then dbms_output.put_line('Error algo salió mal');
end;

You might also like