Buonasera a tutti, è da qualche giorno sto provando a capire il perchè non funge sull create trigger update:
ad esempio in oracle ho usato in questo modo che funziona:
create or replace
TRIGGER @db_user.ModCountDocInMngrTbl
BEFORE Update ON @db_user.DPA_OGGETTI_CUSTOM
FOR EACH ROW
WHEN (new.repertorio != old.repertorio Or new.cha_tipo_tar != old.cha_tipo_tar)
Declare
idTipologia number;
BEGIN
-- Eliminazione dei riferimenti del repertorio dall'anagrafica
DeleteRegistroRepertorio(:new.system_id);
Select ta.system_id Into idTipologia
From @db_user.dpa_tipo_atto ta
Inner Join @db_user.dpa_ogg_custom_comp occ
On ta.system_id = occ.id_template
Where occ.id_ogg_custom = :new.system_id;
-- Se è stato cambiato lo stato del flag repertorio, viene ed è stato passato
-- ad 1, viene eseguito l'inserimento di un riferimento nell'anagrafica
If :new.repertorio = '1' Then
@db_user.InsertRegistroRepertorio(idTipologia, :new.system_id, :new.cha_tipo_tar, 'D');
End If;
End;
/
e ho tradotto in SQL server:
e l'errore mi restituisce:
Msg 4104, Level 16, State 1, Procedure ModCountDocInMngrTbl, Line 37
The multi-part identifier "old.repertorio" could not be bound.
Msg 4104, Level 16, State 1, Procedure ModCountDocInMngrTbl, Line 37
The multi-part identifier "old.cha_tipo_tar" could not be bound.
ho girato un pò nella rete e non sto più capendo... :-(
Grazie
----
..:: GSFLASH ::..
http://www.gsflash.it
http://blogs.dotnethell.it/gabrieleserpi/
MCTS - ACP - OCP - ECDL - ACSP
Ubuntu 11.04/OpenSuse 10.3
Vista Seven/MacOSX SnowLeopard