mysql function ro creat a table

Solutions on MaxInterview for mysql function ro creat a table by the best coders in the world

showing results for - "mysql function ro creat a table"
Elisa
25 Oct 2018
1
2        
3            
4        
5     DELIMITER $$
6
7CREATE PROCEDURE GetCustomerLevel(
8    IN  customerNo INT,  
9    OUT customerLevel VARCHAR(20)
10)
11BEGIN
12
13	DECLARE credit DEC(10,2) DEFAULT 0;
14    
15    -- get credit limit of a customer
16    SELECT 
17		creditLimit 
18	INTO credit
19    FROM customers
20    WHERE 
21		customerNumber = customerNo;
22    
23    -- call the function 
24    SET customerLevel = CustomerLevel(credit);
25END$$
26
27DELIMITER ;Code language: SQL (Structured Query Language) (sql)