Manipulating Interval Datatypes
Posted in 1999
Topics: Platform-Specific Issues, Versions, Editions & End-of-Life
Folks - (IDS 7.30UC5 on Solaris) I've pored through the Informix docs, and am coming up baffled. I am subtracting two datetime (year to second) fields to produce an Interval field. I'm looking for a way to convert this interval (which includes minutes and seconds) to either all seconds or an integer value representing those seconds. Thanks! Rich -- Richard C. Auslander Database Manager AirFlash, Inc. 1733 Woodside Rd., Suite #110 Redwood City, CA 94061 (650) 556-7928 www.airflash.com
Hi there .... try this, it works for me...
database XXXX
main
define a interval second(9) to second
define b interval day to second
define x, y datetime year to second
whenever any error stop
declare c1 cursor for
select starting_timestamp, finish_timestamp from cron_prog_log
foreach c1 into x, y
let a = y - x
let b = y - x
display x, " ", y, b, a
sleep 2
end foreach
end main
I am pretty sure that "let b = a" would have worked equally well.
- Paul