Re: V2.1 and V7.21 SE - different query results
Posted in 1996
In <848915135.3275.0@nabson.derwent.co.uk> nabson@derwent.co.uk (Nick Abson) writes:
>I've just moved a 4gl app from a SCO box running informix-SE v2 to
>Informix-SE v7.21 on Solaris.
>I used to be able to include operands in my insert statements with no
>problems
>e.g.
>insert into table table1 (column1) values (1+1);
>When I try this on V7 I get a syntax error.
>Can someone pls explain why!
There are two reasons you might be encoutering this error. The insert
statement doesn't need the "into table table1" part of your sample, it
just wants "into table1".
The second possibility is that the insert statement's VALUES clause does
not allow expessions (only literals, constants and the like). If you want
to include expressions you need to change the insert to include a select
statement. i.e.
insert into table1(column1, column2, column3)
select (field1, field2 * 1.1, field3 + 6)
from wherever
Another justification for going on that touch typing course you were always
promising yourself you would :)
Bryan Tonnet
batonnet@zeta.org.au