how to convert sql trigger to mysql
Dear all
i shifted from sql server to mysql . i wrote one trigger in sql server but now i m facing issues while converting it to mysql.
can anyone please help me
below is the trigger
USE [medicav1]
GO
/****** Object: Trigger [dbo].[COI_tri] Script Date: 7/15/2022 1:27:20 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER TRIGGER [dbo].[COI_tri] ON [dbo].[COA]
FOR INSERT, UPDATE
AS
BEGIN
SET NOCOUNT ON
IF NOT EXISTS ( SELECT * FROM inserted)
RETURN
UPDATE dbo.COA
SET accounttype = CASE WHEN COA.openingbalance > 0 THEN 'DR'
ELSE 'CR' END
FROM dbo.COA COA
WHERE EXISTS ( SELECT *
FROM inserted i
WHERE i.coaid = COA.coaid
)
END
Subject
Views
Written By
Posted
how to convert sql trigger to mysql
622
July 15, 2022 03:25AM
272
July 15, 2022 06:35AM
259
July 15, 2022 03:40PM
309
July 15, 2022 08:44PM
244
July 15, 2022 10:22PM
332
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.