sql server - SQLite INSTEAD OF TRIGGER -
i want convert microsoft sql server trigger
alter trigger [dbo].[trg_eliminoitems] on [dbo].[pedidosencabezado] instead of delete begin set nocount on; insert histpedidosencabezado select * pedidosencabezado pedidosid in ( select pedidosid deleted ) insert histpedidositems select * pedidositems pedidosid in ( select pedidosid deleted ) delete pedidositems pedidosid in ( select pedidosid deleted ) delete pedidosencabezado pedidosid in ( select pedidosid deleted ) end
into sqlite.
sqlite not allow instead of
triggers on tables, going delete records anyway:
create trigger trg_eliminoitems before delete on pedidosencabezado each row begin insert histpedidosencabezado select * pedidosencabezado pedidosid = old.pedidosid; insert histpedidositems select * pedidositems pedidosid = old.pedidosid; delete pedidositems pedidosid = old.pedidosid; end;
Comments
Post a Comment