create procedure "informix".get_second(str_time datetime year to second,end_time datetime year to second) returning integer; define day1 varchar(20); define day2 integer; let day1=(end_time - str_time)*24*3600; let day2=substr(day1,1,10); return day2; end procedure;
在执行此存储过程之后,可以在数据库中直接执行 select get_second('2007-04-05 10:00:00','2007-04-06 23:10:00') from tabname.