MySQL Forums
Forum List  »  PHP

Mysql User-Defined Function SQL query error ?????????
Posted by: liang chen
Date: March 14, 2016 02:48AM

$mysqli->multi_query("

delimiter $$
drop function if exists newcount$$

CREATE FUNCTION newcount(u char)
RETURNS VARCHAR(60)
BEGIN
DECLARE c varchar(1000);
DECLARE tc varchar(1000);
DECLARE n int;
set c='';
set tc=(select ~~~~~~~~~~~~);
set n=0;
WHILE tc!='' DO
if(c='') then set c=tc;
else set c=CONCAT(c, ',', tc);
end if;
set tc=(select ~~~~~~~~~~~);
set n=n+1;
END WHILE;
return c;
END$$
delimiter ;
select newcount(1) as c;

");


error !

run the sql on mysql command line client was correct ????

Options: ReplyQuote


Subject
Written By
Posted
Mysql User-Defined Function SQL query error ?????????
March 14, 2016 02:48AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.