Re: insert current + 3 units second
Posted in 2000
Hi all,
We are unable upgrade our 7.22 version to 9.21 right now, therefore this is what I am
forced to use:
EXEC SQL INSERT INTO table
(cmd, tstamp, reply, info, string)
VALUES
(:cmd, current, :text, :byte, :string);
EXEC SQL UPDATE table
SET tstamp = current + :sec units
WHERE cmd = :cmd;
Thanks all for your reply.
julia
Obnoxio The Clown wrote:
> Upgrade?
>
> From: "Ousmanov (Julia)" <julia@farelogix.com>
> >
> >Thanks for the hint it does work for 9.21, but it doesn't for 7.22. Any
> >other ideas?
> >
> >julia
> >
> >Obnoxio The Clown wrote:
> >
> > > From: "Mark D. Stock" <mdstock@mydas.freeserve.co.uk>
> > > >
> > > >"Ousmanov (Julia)" wrote:
> > > > >
> > > > > 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.
> > >
> > > Oh?
> > >
> > > create table obnox (col1 int);
> > > insert into obnox values (5+5);> > >
> > > Table created.
> > >
> > > 1 row(s) inserted.
> > >
> > > I must be doing something wrong then. :-)
> > >
> > >
> >_____________________________________________________________________________________
> > > Get more from the Web. FREE MSN Explorer download :
> >http://explorer.msn.com
> >
>
> _____________________________________________________________________________________
> Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com