Answers for "mysql function ro creat a table"

SQL
0

mysql function ro creat a table

DELIMITER $$

CREATE PROCEDURE GetCustomerLevel(
    IN  customerNo INT,  
    OUT customerLevel VARCHAR(20)
)
BEGIN

	DECLARE credit DEC(10,2) DEFAULT 0;
    
    -- get credit limit of a customer
    SELECT 
		creditLimit 
	INTO credit
    FROM customers
    WHERE 
		customerNumber = customerNo;
    
    -- call the function 
    SET customerLevel = CustomerLevel(credit);
END$$

DELIMITER ;Code language: SQL (Structured Query Language) (sql)
Posted by: Guest on February-24-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language