Boa tarde amigos, estou tentando criar uma trigger para incrementar 
a minha tabela alunos, porem está dando erro. alguem poderia me 
ajudar.

create or replace trigger trg_incrementar_alunos
before insert  on alunos
declare v_aux number;
begin
   if (inserting ) then 
     begin
       select nextval into v_aux  from seq_alunos;
     exception
         when others then 
           Null;
     end;
   end if;  
   New.codaluno := v_aux;
end trg_incrementar_alunos;

aguardo ajuda.

obrigado.





-- 
<<<<< FAVOR REMOVER ESTA PARTE AO RESPONDER ESTA MENSAGEM >>>>>

<*> Para ver as mensagens antigas, acesse:
    http://br.groups.yahoo.com/group/delphi-br/messages

<*> Para falar com o moderador, envie um e-mail para:
    [EMAIL PROTECTED]
 
Links do Yahoo! Grupos

<*> Para visitar o site do seu grupo na web, acesse:
    http://br.groups.yahoo.com/group/delphi-br/

<*> Para sair deste grupo, envie um e-mail para:
    [EMAIL PROTECTED]

<*> O uso que você faz do Yahoo! Grupos está sujeito aos:
    http://br.yahoo.com/info/utos.html

 

Responder a