Which version of ESQL/C are you using?
Basically, you need to simulate the following I4GL code in ESQL/C:
DEFINE dt DATETIME YEAR TO MINUTE
LET dt = CURRENT YEAR TO MINUTE
LET dt = dt + 15 UNITS MINUTE
You therefore need to study the manual entry for dtaddinv() which is in the
7.20 ESQL/C manual (page 6-40), and also in the 6.00 ESQL/C manual, but not
in the 5.0x ESQL/C manual.
You will be creating an INTERVAL MINUTE TO MINUTE variable with the value
15 -- incvasc() -- and then adding it:
int rc;
rc = dtaddinv(&dt, &in, &dt);
If there is a problem, rc will contain the error code. You might need to
have 2 datetime variables -- one for the input and one for the result.
Yours,
Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>
>From: Aamir Farooq <aamir@minerva.robadome.com>
>Date: Wed, 07 Aug 1996 11:43:08 -0700
>X-Informix-List-Id: <news.26929>
>
>Hello,
>
> I need some help with ESQL/C. I am generating a table which has a
>datetime field. I need to insert several entries in the table, each one
>with a different datetime value. (i.e. increment datetime value by 15
>minutes each time).
>
> I suppose one way to do this is to insert a datetime value and then
>update it, but I run into problems of duplicate indices. Ideally, I
>would like to be able to create a host variable and initialize it and
>then increment this host variable by 15 minutes and insert it into the
>table. Is there a way to do this?
>
>Thanks a bunch (I hope what I described makes sense),
>
>Aamir Farooq
>aamir@minerva.robadome.com
>aamir@eecs.berkeley.edu
>