CREATE FUNCTION `qc_pgmplanscale`($project int) RETURNS float (10,2)
BEGIN
   declare programScale float (10,2) default 0__DELIMITER__
   select `scale` from zt_workestimation where project = $project into programScale__DELIMITER__
   return programScale__DELIMITER__
END