Intervals in ESQL
Posted in 2000
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
Hello: I have two "datetime hour to fraction" variables in ESQL/C. I want to obtain the difference in an interval variable expressed in seconds: How can i do it? thanks a lot, Luis.
"GDES Urcia Nomberto Luis A." wrote: > I have two "datetime hour to fraction" variables in ESQL/C. I want > to obtain the difference in an interval variable expressed in seconds: How > can i do it? Several years ago, I posted some code to do this, and all the plausible variants. The functions were called something like iv_second, iv_minute, iv_hour, etc, and included fractions of the relevant unit. It converted the result into a DECIMAL rather than an INTERVAL. You should try digging up that code in the IIUG archive and/or Deja (was DejaNews). You might need to look for it under my alter ego johnl@informix.com -- it was a long time ago! I still have the code at the office if all else fails. -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix v1.00.PC1 -- see http://www.perl.com/CPAN #include <disclaimer.h>
"GDES Urcia Nomberto Luis A." wrote: > Hello: > I have two "datetime hour to fraction" variables in ESQL/C. I want > to obtain the difference in an interval variable expressed in seconds: How > can i do it? > > thanks a lot, > > Luis. There's an example in the ESQL manual that work fine - dtsub.ec. You should be able to find the code in $INFORMIXDIR/demo/esqlc. In essence, one employs the built in esql function, dtsub. Rudy