CREATE OR REPLACE FUNCTION GETTHETIME(OLDTIME IN INT)
RETURN VARCHAR2
IS
THEHOUR int;
THEMIN int;
THESEC int;
STRTIME VARCHAR2(2000);
BEGIN
IF OLDTIME < 60 THEN
STRTIME := TO_CHAR(OLDTIME) || '''秒''';
ELSE
THEMIN := OLDTIME/60;
THESEC := MOD(60,OLDTIME);
IF THEMIN >= 60 THEN
THEHOUR := THEMIN/60;
THEMIN := MOD(60,THEMIN);
STRTIME := TO_CHAR(THEHOUR) || '''小时''' || TO_CHAR(THEMIN)
|| '''分''' || TO_CHAR(THESEC) || '''秒''';
ELSE
STRTIME := TO_CHAR(THEMIN) || '''分''' || TO_CHAR(THESEC)
|| '''秒''';
END IF;
END IF;
return StrTime;
END GETTHETIME;