Ver Mensaje Individual
  #2 (permalink)  
Antiguo 18/09/2009, 03:26
Avatar de matanga
matanga
 
Fecha de Ingreso: octubre-2007
Ubicación: España
Mensajes: 1.091
Antigüedad: 16 años, 6 meses
Puntos: 85
Respuesta: PROBLEMAS CON EXCEPTION pl

Siempre se pueden anidar las excepciones.

Código:
begin

 select nom_bod into nom 
  from bodega 
 where cod_bod = codigo_bodega;

 select titulo into tit 
  from rep_cuadro
 where cod_rep = codigo_reproduccion;

 begin

  select cantidad into cant from existencia
  where cod_bod = codigo_bodega 
             and cod_rep = codigo_reproduccion;

  if cant <> 0 then
   dbms_output.put_line('entre');
  end if;

 exception
   when no_data_found then
   //la combinación no existe y se debe insertar;
 end;   

EXCEPTION
WHEN NO_DATA_FOUND THEN
dbms_output.put_line('no/insertar');
end;
Saludos