Hi all,
I have some troubles writing possibly very simple statement:
INSERT INTO sb_cache (cmd, tstamp) VALUES("test cmd", CURRENT + 5 UNITSSECOND);
table sb_cache:
cmd - char32
tstamp - datetime year to fraction(3)
We use Informix 7.22 and 9.21 and I need this statement to work on both
of them.
Thanks for your help
julia
↪ replying to Ousmanov (Julia)
If your column is a DATETIME column it is not possible to have that
statement to work with both releases, it is necessary a workaround (see
later).
9.21 release notes say:
Bug 102224: ADDING TWO DATETIME COLUMN RETURNS ERROR 1260
---------------------------------------------------------
The following are invalid operations on DATETIME or DATE
columns:
datetime +/-/*/DIV datetime
(unary -) datetime
After all invalid operations, the user should receive error
message -1263.
The only valid binary operation on DATETIME or DATE columns
are the following operations:
datetime - interval
datetime + interval
interval + datetime
interval + date
datetime - date
date - datetime
date - interval
date + interval
The following is the workaround we found:
EXTEND(first_date+num_seconds units second,YEAR TO SECOND) < > =
EXTEND(second_date,YEAR TO SECOND)
flavio gattari
Ousmanov (Julia) ha scritto nel messaggio
<8veaj1$db3$1@news.xmission.com>...
>
>Hi all,
>
>I have some troubles writing possibly very simple statement:
>
>INSERT INTO sb_cache (cmd, tstamp) VALUES("test cmd", CURRENT + 5 UNITS>SECOND);
>
>table sb_cache:
>cmd - char32
>tstamp - datetime year to fraction(3)
>
>We use Informix 7.22 and 9.21 and I need this statement to work on both
>of them.
>
>Thanks for your help
>julia
>