755756757758759760761762763764765
case Tokens.SQL_TSI_FRAC_SECOND : t = Type.SQL_INTERVAL_SECOND_MAX_PRECISION; IntervalSecondData interval = (IntervalSecondData) t.subtract(a, b, null); return new Long( DTIType.limitNanoseconds * interval.getSeconds() + interval.getNanos());
764765766767768769770771772773774
+ interval.getNanos()); case Tokens.SQL_TSI_SECOND : t = Type.SQL_INTERVAL_SECOND_MAX_PRECISION; return new Long(t.convertToLong(t.subtract(a, b, null))); case Tokens.SQL_TSI_MINUTE : t = Type.SQL_INTERVAL_MINUTE_MAX_PRECISION;
770771772773774775776777778779780
null))); case Tokens.SQL_TSI_MINUTE : t = Type.SQL_INTERVAL_MINUTE_MAX_PRECISION; return new Long(t.convertToLong(t.subtract(a, b, null))); case Tokens.SQL_TSI_HOUR : t = Type.SQL_INTERVAL_HOUR_MAX_PRECISION;
776777778779780781782783784785786
null))); case Tokens.SQL_TSI_HOUR : t = Type.SQL_INTERVAL_HOUR_MAX_PRECISION; return new Long(t.convertToLong(t.subtract(a, b, null))); case Tokens.SQL_TSI_DAY : t = Type.SQL_INTERVAL_DAY_MAX_PRECISION;
782783784785786787788789790791792
null))); case Tokens.SQL_TSI_DAY : t = Type.SQL_INTERVAL_DAY_MAX_PRECISION; return new Long(t.convertToLong(t.subtract(a, b, null))); case Tokens.SQL_TSI_WEEK : t = Type.SQL_INTERVAL_DAY_MAX_PRECISION;
788789790791792793794795796797798
null))); case Tokens.SQL_TSI_WEEK : t = Type.SQL_INTERVAL_DAY_MAX_PRECISION; return new Long(t.convertToLong(t.subtract(a, b, null)) / 7); case Tokens.SQL_TSI_MONTH : t = Type.SQL_INTERVAL_MONTH_MAX_PRECISION;
794795796797798799800801802803804
/ 7); case Tokens.SQL_TSI_MONTH : t = Type.SQL_INTERVAL_MONTH_MAX_PRECISION; return new Long(t.convertToLong(t.subtract(a, b, null))); case Tokens.SQL_TSI_QUARTER : t = Type.SQL_INTERVAL_MONTH_MAX_PRECISION;
800801802803804805806807808809810
null))); case Tokens.SQL_TSI_QUARTER : t = Type.SQL_INTERVAL_MONTH_MAX_PRECISION; return new Long(t.convertToLong(t.subtract(a, b, null)) / 3); case Tokens.SQL_TSI_YEAR : t = Type.SQL_INTERVAL_YEAR_MAX_PRECISION;
806807808809810811812813814815816
/ 3); case Tokens.SQL_TSI_YEAR : t = Type.SQL_INTERVAL_YEAR_MAX_PRECISION; return new Long(t.convertToLong(t.subtract(a, b, null))); default : throw Error.runtimeError(ErrorCode.U_S0500, "FunctionCustom");