Re: Host Variables Insertion
Posted in 1998
On Wed, 7 Jan 1998, PRAVEEN MOHANAN wrote: > I am trying to insert data into a table and the stmt is > EXEC SQL INSERT INTO TABLE abc (field1) VALUES (:host1 + :host2); > Is the stmt valid? No. > But it works with pro*c. All sorts of Pro*C extensions work in Pro*C but not in Informix. There are lots of Informix extensions that work in Informix but won't work in Pro*C. The ANSI SQL standard does not allow the notation you are trying to use; Informix happens to hew closer to the standard than Orrible does in this area. > It gives me error 42000 : Syntax error or access violation; That's a syntax error by any other name! In ANSI SQL, and in Informix SQL, you can only use simple variables or constants for each value in the VALUES list of an INSERT statement. Yours, Jonathan Leffler (johnl@informix.com) #include <witticism.h>