I have the following function:
CREATE OR REPLACE Function pode_levar( pedidos NUMBER, viagens NUMBER)
RETURN NUMBER
IS
x NUMBER:=0;
y NUMBER:=0;
TRUE NUMBER:=0;
BEGIN
BEGIN
Select id_pedido into x
from pedido
where id_pedido = pedidos;
EXCEPTION
WHEN NO_DATA FOUND THEN
RAISE_APPLICAITON_ERROR(-20305,'PEDIDO TRANSPORTE ENIXISTENTE');
END;
BEGIN
select lim_vei_vol - volume_total_viagem(viagens) into y
from v viagem , ve veiculo
where v.id_viagem = ve.id_viagem
and id_viagem = viagens;
EXCEPTION
WHEN NO_DATA_FOUND THEN
TRUE:=0;
RAISE_APPLICATION_ERROR(-20304,'Viagem Enixistente');
RETURN(TRUE);
END;
BEGIN
IF y <> 0
TRUE := 1;
RETURN(TRUE);
ELSE
TRUE := 0;
RETURN(TRUE);
ENDIF;
END;
END;
The function compiles with one warning, how can I see it? show errors does not work
This is for school,
You should use SQL* Plus and set
ALTER SESSION SET PLSQL_WARNINGS = 'ENABLE:ALL';
before you create your function. This setting will show you any warnings by using
SHOW ERRORS;
Read: http://docs.oracle.com/cd/B28359_01/server.111/b28320/initparams186.htm#REFRN10249
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With