我正在尝试实现如下所示的目标,但我错了——逻辑、语法和其他一切。你能帮我么?
我正在尝试SET STATIC =
基于某些条件。如果是这样PHP
,我会使用Break
. 我走了这么远,但没有任何效果。你能看到怎么做吗?
CREATE DEFINER=`root`@`localhost` FUNCTION `caseTest`(`n` INT)
RETURNS varchar(512)
LANGUAGE SQL
DETERMINISTIC
CONTAINS SQL
SQL SECURITY DEFINER
COMMENT ''
BEGIN
DECLARE x VARCHAR(1500);
DECLARE y VARCHAR(1500);
DECLARE static VARCHAR(1500);
CASE n
WHEN '14' THEN SET x = 'Place Order Link';
WHEN '01' THEN SET x = 'Cancel Order Link';
WHEN '11' THEN SET x = 'Order Cancelled - Place order link';
SET static = concat(<a href="">,x,</a>);
WHEN '00' THEN SET x = 'Order - Under Process'; #No link here
WHEN '10' THEN SET x = 'Cancel - Under Process'; #No link here
SET static = x;
ELSE SET static = 'Error generating link';
END;
set y = 'Flag Link ~ Edit Link ~ Move Link';
RETURN concat(x,y);
END