$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 select max(ct_datetime) into :arg_ctdate from sys_ct_data; if sqlca.sqlcode = -1 then rslt = 0 arg_msg = '查询最后截数日期出错' goto ext elseif sqlca.sqlcode = 100 or isnull(arg_ctdate) then rslt=2 end if ext: return rslt end function