Wrong number of parameters. SQLSTATE=07001

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
Inquisitive
Charter Member
Charter Member
Posts: 88
Joined: Tue Jan 13, 2004 3:07 pm

Wrong number of parameters. SQLSTATE=07001

Post 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 ?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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 "<=" ?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
bigpoppa
Participant
Posts: 190
Joined: Fri Feb 28, 2003 11:39 am

Wrong number of parameters. SQLSTATE=07001

Post 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
Post Reply