Last active
November 21, 2024 18:15
-
-
Save MinaGabriel/93ed79247caa8a2180f3192c33f56045 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
USE ap; | |
DROP PROCEDURE IF EXISTS test; | |
DELIMITER | |
CREATE PROCEDURE test(IN vid_input INT, OUT message VARCHAR(500)) | |
BEGIN | |
DECLARE term_id VARCHAR(225); | |
SELECT default_terms_id | |
INTO term_id | |
FROM vendors | |
WHERE vendor_id = vid_input; | |
CASE term_id | |
WHEN 1 THEN | |
SET message = 'Net due 10 days'; | |
WHEN 2 THEN | |
SET message = 'Net due 20 days'; | |
WHEN 3 THEN | |
SET message = 'Net due 30 days'; | |
ELSE | |
SET message = 'Net due more than 30 days'; | |
END CASE; | |
END | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment