CREATE PROCEDURE `spAddOnlineMeetingAccount` ( IN `P_AccountId` INTEGER , IN `P_TeacherId` INTEGER , IN `P_BatchId` INTEGER , IN `P_AccountName` VARCHARACTER (?) , IN `P_AccountEmailId` VARCHARACTER (?) , IN `P_AccountPassword` VARCHARACTER (?) , IN `P_APIKey` VARCHARACTER (?) , IN `P_APISecret` VARCHARACTER (?) , IN `P_WebApiKey` VARCHARACTER (?) , IN `P_WebApiSecret` VARCHARACTER (?) , IN `P_JWTToken` VARCHARACTER (?) , IN `P_UserId` INTEGER ) BEGIN IF `P_AccountId` = ? THEN IF NOT EXISTS ( SELECT ? FROM `tonlinelecturemeetingaccount` WHERE `TeacherId` = `P_TeacherId` AND `BatchId` = `P_BatchId` ) THEN INSERT INTO `vida_lms` . `tonlinelecturemeetingaccount` ( `TeacherId` , `BatchId` , `AccountName` , `AccountEmailId` , `AccountPassword` , `APIKey` , `APISecret` , `WebApiKey` , `WebApiSecret` , `JWTToken` , `CreatedUserId` , `CreatedDateTime` ) VALUES ( `P_TeacherId` , `P_BatchId` , `P_AccountName` , `P_AccountEmailId` , `P_AccountPassword` , `P_APIKey` , `P_APISecret` , `P_WebApiKey` , `P_WebApiSecret` , `P_JWTToken` , `P_UserId` , NOW ( ) ) ; SELECT `LAST_INSERT_ID` ( ) ; ELSE SELECT ? ; END IF ; ELSEIF `P_AccountId` > ? THEN UPDATE `vida_lms` . `tonlinelecturemeetingaccount` SET 