Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Mira Jungholdt — — source: Usenet: comp.databases.informix
Is there a way to get a date - SQL-Variable into an int -
C++-Variable.
Just like that:
EXEC SQL START DECLARE SECTION;
int date;
EXEC SQL END DECLARE SECTION;
EXEC SQL SELECT thedate INTO :date from x WHERE id=1;
Or is it posible to manipulate a char[..] to useful integer variable.
Is there for example a function with gives the days from the 1.1.1900
till that day (char[]) back?
I hope you understand my problem
thanks mira
↪ replying to Mira Jungholdt
Art S. Kagel — — source: Usenet: comp.databases.informix
On Tue, 17 Jun 2003 05:56:19 -0400, Mira Jungholdt wrote:
> Is there a way to get a date - SQL-Variable into an int - C++-Variable.
>
> Just like that:
> EXEC SQL START DECLARE SECTION;
> int date;
> EXEC SQL END DECLARE SECTION;
>
> EXEC SQL SELECT thedate INTO :date from x WHERE id=1;
Exactly like that! Try it. The host variable date will contain the
Informix date (#days since 12/31/1899). If you need this as a UNIX
time_t or text format, there are library functions in the ESQL/C library
and others posted on the IIUG Repository.
> Or is it posible to manipulate a char[..] to useful integer variable. Is
> there for example a function with gives the days from the 1.1.1900 till
> that day (char[]) back?
>
> I hope you understand my problem
> thanks mira
Art S. Kagel
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.