Re: Multiple values for IN keyword of WHERE clause don't appear to work with InfxPreparedStatement



Thanks Arne,
I tested with your reply in mind and now I know what the problem is I
can get on and fix it.

Arne Vajhøj wrote:
mlapidge wrote:
Any views on the following behaviour would be appreciated. I am using

INFORMIX-OnLine 7.31.UD7
IBM Informix JDBC Driver for IBM Informix Dynamic Server 2.21.JC5

Some code....

PreparedStatement ifxStmt2 = ifxCxn.preparedStatement("select iddoc
from corrapp where identity IN (?));

This works - with only one value in the list of IN values to bind...

ifxStmt2.setString(bind, "'000000010'");

However, if I add a second value to the list of IN values (below I just
duplicate the first value and expect the same set of results) an empty
ResultSet object is returned (no exceptions raised)...

ifxStmt2.setString(bind, "'000000010','000000010");

I would not expect it to work.

? reprensents one value.

"'000000010'" which I would write as "000000010" is
one value.

"'000000010','000000010'" is one value too - just with
a comma in.

You should either:
- add the same number of ?'s as you have values
- use oldfashioned risky values directly in SQL
- redesign so you do not need it

Arne

.



Relevant Pages

  • Re: DBD::Informix Build Error On 64bit AIX 5.2
    ... command line is screwing up something that Perl itself is relying on. ... > 5.2 using the IBM vac C compiler. ... > Configuring IBM Informix Database Driver for Perl DBI Version 2005.01 ...
    (perl.dbi.users)
  • Re: Why Informix is Best
    ... When adding raw disk space Oracle zeros out the whole raw disk space ... 2Gb chunks in a few seconds under Informix. ... sysmaster database allows monitor of the database via sql allowing you ... IBM Informix has direct to engineer support whereas Oracle pass you to ...
    (comp.databases.informix)
  • Re: Multiple values for IN keyword of WHERE clause dont appear to work with InfxPreparedStatement
    ... can get on and fix it. ... Arne Vajhøj wrote: ... IBM Informix JDBC Driver for IBM Informix Dynamic Server 2.21.JC5 ...
    (comp.lang.java.databases)
  • Re: ISM volume mount problem
    ... the "System Admin Guide/Refernce" manuals. ... IBM Informix Development Munich, Germany ... I've a problem with a volume in the ISM. ...
    (comp.databases.informix)
  • [Fwd: What is Cheetah 2 and how will it impact your business?]
    ... its nice to get an email from Ziff Davis about Informix and see pictures of people I know;) - Lester ... Join us for this live, interactive eSeminar roundtable discussion, directly from the IIUG Power conference in Overland Park, Kansas. ... Our discussion will be led by IBM Informix Lab Director Jerry Keesee, and will allow you the chance to interact with the IDS 'Power' team of architects. ... Register now for this exclusive event - and get the inside scoop on the latest and greatest from IBM Informix. ...
    (comp.databases.informix)