DELIMITER $$
DROP FUNCTION IF EXISTS `gtonline`.`func_delgroups`$$
CREATE FUNCTION `gtonline`.`func_delgroups`(ngrpid INT )
RETURNS INT
/*LANGUAGE SQL
| [NOT] DETERMINISTIC
| { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }
| SQL SECURITY { DEFINER | INVOKER }
| COMMENT 'string'*/
BEGIN
DECLARE xid INT default 0;
delete from t_groupsinfo where ID=ngrpid;
delete from t_groupsuser where GroupID=ngrpid;
return 0;
END$$
DELIMITER ;