以下のMS SQL Server上に作成されたストアドプロシージャをMySQL上で実行できるストアドプロシージャに作成する必要があります。MYSQLにする場合の記述内容について教えて頂けますでしょうか
USE [SupportTools] GO /****** Object: StoredProcedure [dbo].[SetReceiveMail] Script Date: 10/29/2019 11:10:37 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE procedure [dbo].[SetReceiveMail] @ReceiveMailID as int = null output, @MailTo as varchar(100), @MailFrom as varchar(100), @MailSubject as varchar(500), @MailBody as varchar(8000), @MailDate as smalldatetime as set @MailTo = isnull(@MailTo, '') set @MailFrom = isnull(@MailFrom, '') set @MailSubject = isnull(@MailSubject, '') set @MailBody = isnull(@MailBody, '') set @MailDate = isnull(@MailDate, '') if @MailTo = '' and @MailFrom = '' begin return 0 end begin tran if @ReceiveMailID is null begin insert into ReceiveMail(MailTo,MailFrom,MailSubject,MailBody,MailDate) values(@MailTo,@MailFrom,@MailSubject,@MailBody,@MailDate) set @ReceiveMailID = @@IDENTITY end else begin update ReceiveMail set MailTo = @MailTo, MailFrom = @MailFrom, MailSubject = @MailSubject, MailBody = @MailBody, MailDate = @MailDate where ReceiveMailID = @ReceiveMailID end commit tran
回答3件
あなたの回答
tips
プレビュー