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