create function getOrgLevelName(orgid varchar(100)) returns varchar(100)
BEGIN
	DECLARE result VARCHAR(100); 
	declare i int default 0;
	DECLARE num INT;
	set num=(LENGTH(orgid)-9)/4;
	set result=getOrgName(LEFT(orgid,9));
	if num>0
	then
	    myloop:loop
	    set i=i+1;
	    set result=concat(concat(result,'>>'),getOrgName(LEFT(orgid,9+4*i)));
	    if i>=num
	    then
	        leave myloop;
	    END IF;
	    end loop myloop; 
	end if;
	return result;
    END;

