SHARE
TWEET

Untitled

a guest Jun 19th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. BEGIN
  2.     DECLARE MEMBER_STATE VARCHAR(3);
  3.  
  4.     SET @NURSERY_ADDRESS = (SELECT NURSERY_ADDRESS FROM COOP_MEMBERS WHERE
  5.     COOP_MEMBERS.MEMBER_ID = MEMBER_ID);
  6.  
  7.     CASE
  8.         WHEN @NURSERY_ADDRESS LIKE '% QLD %' THEN SET EMPLOYEE_STATE = 'QLD';
  9.         WHEN @NURSERY_ADDRESS LIKE '% VIC %' THEN SET EMPLOYEE_STATE = 'VIC';
  10.         WHEN @NURSERY_ADDRESS LIKE '% NSW %' THEN SET EMPLOYEE_STATE = 'NSW';
  11.         WHEN @NURSERY_ADDRESS LIKE '% NT %' THEN SET EMPLOYEE_STATE = 'NT';
  12.         WHEN @NURSERY_ADDRESS LIKE '% WA %' THEN SET EMPLOYEE_STATE = 'WA';
  13.         WHEN @NURSERY_ADDRESS LIKE '% ACT %' THEN SET EMPLOYEE_STATE = 'ACT';
  14.         WHEN @NURSERY_ADDRESS LIKE '% SA %' THEN SET EMPLOYEE_STATE = 'SA';
  15.         WHEN @NURSERY_ADDRESS LIKE '% TAS %' THEN SET EMPLOYEE_STATE = 'TAS';
  16.         ELSE
  17.         SET MEMBER_STATE = NULL;
  18.     END CASE;
  19.  
  20.     RETURN MEMBER_STATE;
  21.  
  22. END//
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top