[firebase-br] Trigger x Select II ... Roger 21/04/06
    Roger 
    roger em dgpram.com.br
       
    Sex Abr 21 14:50:52 -03 2006
    
    
  
Olá Pessoal, boa tarde !!
Não obtive qualquer resposta a mensagem anterior,
então estou tentado reformular a pergunta,
pois não sei se havia sido claro o suficiente.
Numa Trigger, por que não teria acesso ao valor de uma variável
´alimentada´ por um select, como no exemplo abaixo ?
Maneira 1:
CREATE TRIGGER REQUISICOES_AU0 FOR REQUISICOES
ACTIVE AFTER UPDATE POSITION 0
AS
 declare variable nparcelas integer;
begin
    select c.cnd_parcelas
     from condicoes c where c.cnd_id = new.cnd_id
      into nparcelas;
    if (new.req_valorrecebido > 0) then
    begin
     >>>> parcelas nunca recebe um valor <<<<<
     new.parcelas = nparcelas;
     ...
    end
...
end
SE FIZER DESTA OUTRA MANEIRA, FUNCIONA !!!
Maneira 2:
CREATE TRIGGER REQUISICOES_AU0 FOR REQUISICOES
ACTIVE AFTER UPDATE POSITION 0
AS
 declare variable nparcelas integer;
begin
    if (new.req_valorrecebido > 0) then
    begin
     select c.cnd_parcelas
      from condicoes c where c.cnd_id = new.cnd_id
       into nparcelas;
     >>>> aqui parcelas recebe um valor <<<<<
     new.parcelas = nparcelas;
     ...
    end
...
end
ALGUÉM SABERIA ME INFORMAR ONDE ESTOU ERRANDO ??
Obrigado
[]´s Roger
--------------------------------------------------
Esta mensagem foi verificada por Ultralink-Scanner
e nenhum virus foi encontrado.
Web Server Ultralink: http://www.ultralink.com.br
--------------------------------------------------
    
    
Mais detalhes sobre a lista de discussão lista