Created
May 31, 2020 17:09
-
-
Save prashant4224/519d70f567480d6672f241f31d07b4ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELIMITER $$ | |
CREATE PROCEDURE GetCustomerLevel( | |
IN pCustomerNumber INT, | |
OUT pCustomerLevel VARCHAR(20)) | |
BEGIN | |
DECLARE credit DECIMAL(10,2) DEFAULT 0; | |
SELECT creditLimit | |
INTO credit | |
FROM customers | |
WHERE customerNumber = pCustomerNumber; | |
IF credit > 50000 THEN | |
SET pCustomerLevel = 'PLATINUM'; | |
END IF; | |
END$$ | |
DELIMITER ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment