Page 1 of 1

Wrong number of parameters. SQLSTATE=07001

Posted: Sat Jan 24, 2004 5:18 am
by Inquisitive
I get the following error message when I do a comparision on two date fields

[IBM][CLI Driver] CLI0100E Wrong number of parameters. SQLSTATE=07001

The user defined query in the UDB Stage is:
SELECT A,B,C,CREAT_D FROM DB2PROD.ALPHA WHERE CREATE_D > ? ;

My job runs if I replace the '>' with '='. It aborts when the operator is either '<' or '>'

I tried changing the datatype to varchar of length 10 but it didnt help. The date format is yyyy-mm-dd

Any suggestions ?

Posted: Sat Jan 24, 2004 4:05 pm
by ray.wurlod
It's probably no help, but the beginning of the error message (the tokens in square brackets) indicate that it is the client software, not the database server, that is generating this error message.
From your query I can determine that this SQL is being executed on a DB2 stage serving rows to a reference input link (because there is a parameterised WHERE clause).
That the behaviour is different with different operators is a bit of a mystery, but let's pursue it.
Any reference input with "=", assuming you haven't lied about which column is the key column, will only ever return one row. Any reference with a different operator can potentially return more than one row.
As far as I am aware the DB2 stage is not equipped to return more than one row to serve a reference input link. The stage or the client software may have detected this and generated the error message.
What happens if your comparison operator is ">=" or "<=" ?

Wrong number of parameters. SQLSTATE=07001

Posted: Sun Jan 25, 2004 2:51 pm
by bigpoppa
A thought for a hack:

A parser somewhere in this job must be expecting '>' and '<' to be special characters. Could you try escaping the '>', like '/>', in your query?

Ultimately I believe you have discovered (or rediscovered) a bug with the DB2 stage.

-BP