Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --#SET TERMINATOR @
- CREATE PROCEDURE HRISDIM.USP_SET_EMAIL_NOTIFICATION_SETTING(IN userKey DECIMAL(15, 0),
- IN emailNotificationSetting VARCHAR(30))
- P1:
- BEGIN
- DECLARE userEntriesCount BIGINT;
- SELECT COUNT(CNS.ID)
- INTO userEntriesCount
- FROM HRISDIM.COMS_NOTIFICATION_SETTINGS CNS
- WHERE CNS.USER_KEY = userKey;
- --If there is entry for that user key, update it, otherwise create new one.
- IF userEntriesCount > 0 THEN
- UPDATE HRISDIM.COMS_NOTIFICATION_SETTINGS
- SET EMAIL_NOTIFICATION_TYPE = emailNotificationSetting
- WHERE USER_KEY = userKey;
- ELSE
- INSERT INTO HRISDIM.COMS_NOTIFICATION_SETTINGS (USER_KEY, EMAIL_NOTIFICATION_TYPE)
- VALUES (userKey, emailNotificationSetting);
- END IF;
- END P1 @
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement