Tema: ayuda pl
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 24/09/2009, 11:21
albokiller
 
Fecha de Ingreso: septiembre-2009
Mensajes: 8
Antigüedad: 14 años, 7 meses
Puntos: 0
ayuda pl

create or replace procedure rrrep_solicita(fecha_v pedido.fecha%type)
is

cursor c1
is
select num_ped
from pedido
where fecha >= fecha_v;

cursor c2
is
select cod_rep
from det_pedido
where num_ped = n_ped;

suma number;
porc number;

n_ped pedido.num_ped%type;
a_autor rep_cuadro.autor%type;
a_cod rep_cuadro.cod_rep%type;
a_tit rep_cuadro.titulo%type;

begin

open c1;
loop
fetch c1 into n_ped;
exit when c1%notfound;
open c2;
loop
fetch c2 into a_cod;
exit when c2%notfound;
porc := pprom_cant(a_cod);

if porc <> 0 then
select sum(cant_ped) into suma
from det_pedido where cod_rep = a_cod;

if (porc * 2) >= suma and suma > 20 then
select titulo, autor into a_tit, a_autor from rep_cuadro where cod_rep = a_cod;

update existencia set cant_min = round(cant_min * 1.8) where cod_rep = a_cod;
dbms_output.put_line('codigo: ' || a_cod ||' titulo: ' || a_tit ||'autor: ' || a_autor || 'cantidad: ' || suma );

end if;
end if;
end loop;
end loop;
close c1;
close c2;
end;
/


me manda este error:

10/1 PL/SQL: SQL Statement ignored
10/8 PLS-00320: la declaración del tipo de expresión es incompleta o
con forma inadecuada

12/17 PLS-00320: la declaración del tipo de expresión es incompleta o
con forma inadecuada

27/3 PL/SQL: SQL Statement ignored


supongo q es por el cursor, pero porque?
si alguin me puede ayudar.