i using a mysql stored function in my module, but how to create function in database at module installation?
Xoopscube installation don't recognizing the mysql's "DELIMITER $$" command :( and returning this error.
DELIMITER $$ DROP FUNCTION IF EXISTS `ufn_getDepIDs`$$ CREATE FUNCTION `ufn_getDepIDs`(pHosp_cd varchar(7)) RETURNS TEXT DETERMINISTIC READS SQL DATA BEGIN DECLARE done INT DEFAULT 0 is not a valid SQL!
For example my stored function like following:
DROP FUNCTION IF EXISTS `ufn_getDepIDs`$$
CREATE FUNCTION `ufn_getDepIDs`(pCd varchar(7))
READS SQL DATA
DECLARE done INT DEFAULT 0;
DECLARE sReturn TEXT DEFAULT '';
DECLARE tmp VARCHAR(64);
DECLARE cur1 CURSOR FOR
From Table1 CD
Left Join Table2 D On D.Col_CD = CD.Col_cd
Where CD.Col_cd = pCd;
DECLARE CONTINUE HANDLER FOR not found SET done = 1;
FETCH cur1 INTO tmp;
IF NOT done THEN
IF (LENGTH(sReturn) = 0) THEN
SET sReturn = CONCAT(sReturn,tmp);
SET sReturn = CONCAT(sReturn,',', tmp);
Is there any way?
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.