MYSQL自定义函数的应用实例

时间:2017/10/16 15:15:00来源:互联网 作者:flyso 点击: 24 次

DELIMITER //

CREATE FUNCTION getCustomerName(CustomerID INT UNSIGNED) 

RETURNS VARCHAR(100)

BEGIN

DECLARE CustomerName VARCHAR(100);

SELECT name from xyx_customer where customer_id = CustomerID INTO CustomerName;

RETURN CustomerName;

END//


Copyright © 2005 - 2016 flyso.cn. 飞搜 版权所有 鄂ICP备11002783号-3