123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- $PBExportHeader$f_last_ctdate.srf
- global type f_last_ctdate from function_object
- end type
- forward prototypes
- global function integer f_last_ctdate (ref datetime arg_ctdate, ref string arg_msg)
- end prototypes
- global function integer f_last_ctdate (ref datetime arg_ctdate, ref string arg_msg);//取最后截数时间
- Int rslt = 1
- Long cnt
- //IF sys_power_issuper THEN
- // rslt = 1
- // GOTO ext
- //END IF
- SELECT count(*) INTO :cnt
- From sys_ct_data;
- IF sqlca.SQLCode <> 0 THEN
- arg_msg = '查询系统是否曾经截数失败,'+sqlca.SQLErrText
- rslt = 0
- GOTO ext
- END IF
- IF cnt = 0 THEN
- rslt = 2
- GOTO ext
- END IF
- SELECT max(ct_datetime)
- INTO :arg_ctdate
- From sys_ct_data;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '查询最后截数日期出错,'+sqlca.SQLErrText
- GOTO ext
- END IF
- ext:
- RETURN rslt
- end function
|