Os pego el código a ver si me podeis hechar un cable ok?
CREATE OR REPLACE PROCEDURE completaEstadisticos(identAlmacen IN varchar2,producto IN varchar2,cantidad IN varchar2,fecha IN Date) as
cant number;
cantiActual number;
cursor c1 IS select cantidad from pedidosEstadisticos where idProducto=producto and fechacaducidadProducto>fecha;
BEGIN
cantiActual:=cantidad;
open c1;
LOOP
Fetch c1 into cant;
if c1%notfound then
cant := 9999;
else
if cant<cantidad then
insert into copias (nombre,fecha) values('HOLA¡','ADIOS');
cantiActual=cantiActual-cant;
end if
end if
END LOOP
commit;
close c1;
Si lo cierto es que el procedimiento es sencillo pero como es elp rimero que hago...
Espero que me podais ayudar. Gracias!!!






Mode Lineal
