Posted in 2004
I am testing my current java application against Informix (9.4 for Windows)
and am getting an error when I try to prepare the following statement:
// GroupID, ItemID are both integers
// ItemNbr is a string
INSERT INTO GROUPITEM (GroupID, ItemID)select ?, itemid from itemmaster where itemnbr = ?;
I am getting the following error:
ERROR: SQLException: -201 - A syntax error has occurred.
Now I narrowed it down to the SELECT portion of the SQL. It doesn't like the
? in the select statement. I know this because I substituted the ? in the
select statement with a 1 just for testing and it prepared just fine.
This same sql statement works just fine in SQL Server, which this app was
first tested. My question is this: Why is this causing an error? I am
staring at my old 7.X documentation ( yes I have all the manuals ) and in
the Informix-SQL quick syntax guide, it looks like it should be a valid SQL
statement. Is this a problem with the Informix JDBC driver or a problem with
Informix itself? I have no way of testing this in any other environment. I
turned on explain and nothing came out. Any advice on what I can do to
diagnose or fix this problem would be highly appreciated. Thanks.
Mel Haynes Jr
Retail Solutions Group, LLC
We use strictly necessary cookies to make this site work. With your consent we’d also use optional cookies for analytics and marketing. You can accept all, reject all, or choose. Read our Cookie Policy.