Re: insert current + 3 units second
Posted in 2000
"Ousmanov (Julia)" wrote:
>
> 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.
AFAIK the INSERT statement is not capable of performing arithmetic
operations. You will have to perform these first and then supply the
resultant value to the INSERT statement.
If you are doing this in SQL, then you could use something like:
INSERT INTO sb_cache (cmd, tstamp)
SELECT "test cmd", CURRENT YEAR TO FRACTION + 5 UNITS SECOND
FROM systables
WHERE tabid = 1
I haven't tested that, but you get the idea.
Cheers,
--
Mark.
+----------------------------------------------------------+-----------+
| Mark D. Stock mailto:mdstock@mydas.freeserve.co.uk |//////// /|
| http://www.informix.com http://www.informixhandbook.com |///// / //|
| http://www.iiug.org +-----------------------------------+//// / ///|
| |This email will self-destruct in |/// / ////|
| |10 sec. If you received this email |// / /////|
| |in error, sorry about the mess. |/ ////////|
+----------------------+-----------------------------------+-----------+