Re: how to convert sql trigger to mysql
You'll need separate Triggers for Insert and for Update.
No MySQL equivalent for SET ANSI_NULLS ON, SET QUOTED_IDENTIFIER ON, SET NOCOUNT ON.
.
Study the manual page for Create Trigger. You Insert Trigger will probably look something like ...
use medicavl;
drop trigger if exists coa_ins;
delimiter go
create trigger coa_ins before insert on coa for each row
begin
if exists( select 1 from inserted i where i.coald=new.coald ) then
set new.accounttype = if( new.openingbalance > 0, 'DR', 'CR' );
end if;
end;
go
delimiter ;
Edited 1 time(s). Last edit at 07/15/2022 07:57AM by Peter Brawley.
Subject
Views
Written By
Posted
1335
July 15, 2022 03:25AM
Re: how to convert sql trigger to mysql
564
July 15, 2022 06:35AM
588
July 15, 2022 03:40PM
878
July 15, 2022 08:44PM
700
July 15, 2022 10:22PM
674
July 16, 2022 07:23AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.