MySQL 5.7 has a lot of new features. If you've dabbled with an older version of MySQL, it is definitely worth learning.
create procedure getConsumerID @outvar char(9) OUTPUT as declare @ConsumerID int begin transaction select @ConsumerID = fnPartID from tblParticipantNo if @ConsumerID is null begin set @ConsumerID = 1 insert into tblParticipantNo values(@ConsumerID) end else begin update tblParticipantNo set fnPartID=@ConsumerID + 1 end Select @ConsumerID set @outvar=@ConsumerID commit transaction
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.