Fórum TRIGGER que virifica o saldo e gera um exception #53295
11/10/2005
0
JÁ TENTEI FAZER ASSIM MAIS NEM TEM LOGICA
POIS ELE NÃO RECONHECE O IF QUE GERA O exception
ASSIM:
CREAT TRIGGER TESTE_SAIDA
ACTIVE BEFORE INSERT POSITION 0
AS
begin
if (new.cod_lotes > 0) then
begin
if (exists
(select indice from lotes
where indice = new.cod_lotes))
then begin
[color=red:fb203b37f6] if (lotes.saldo < new.peso_liquido) then exception LOTES_SAIDA;[/color:fb203b37f6] end
end
end
thanks e desde já agradeço
Marcos Fernando
Curtir tópico
+ 0Posts
13/10/2005
Afarias
T+
Gostei + 0
13/10/2005
Marcos Fernando
mais não consigo executar a exception
CREATE TRIGGER ROMANEIO_SAIDA_BI0 FOR ROMANEIO_SAIDA
ACTIVE BEFORE INSERT POSITION 0
AS
declare variable s numeric(15,0);
begin
if (new.cod_lotes > 0) then
begin
for select indice from lotes_saida
where indice = new.cod_lotes
into :s do if ( :s < new.peso_liquido) then exception lotes_romaneio;
end
end
Thanks
Gostei + 0
13/10/2005
Beppe
Gostei + 0
14/10/2005
Marcos Fernando
já arrumei select SALDO e não Select Indice,
Grato amigo
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)