Error when running Data stage server job

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

sashah
Participant
Posts: 37
Joined: Thu May 10, 2007 3:02 pm

Error when running Data stage server job

Post by sashah »

I am trying to run a job that has a reference link. There is an ODBC stage that has a reference link to the transformer. This stage returns multiple rows for a particular id which I need to either insert or update into the database. I get the below error when running the job.

DSD.BCIOpenRef call to SQLNumResultCols failed.SQL statement has incorrect number of result columns

Can someone please help.

Thank you
Samir Shah
mikegohl
Premium Member
Premium Member
Posts: 97
Joined: Fri Jun 13, 2003 12:50 pm
Location: Chicago
Contact:

Post by mikegohl »

Do you have the "Reference link with multiple row result set" box checked?
Michael Gohl
sashah
Participant
Posts: 37
Joined: Thu May 10, 2007 3:02 pm

Multiple Resultset check box

Post by sashah »

Micheal,

Thank you for your reply.

Where do I find multiple results check box to check it.

Thank you
Samir
mikegohl
Premium Member
Premium Member
Posts: 97
Joined: Fri Jun 13, 2003 12:50 pm
Location: Chicago
Contact:

Post by mikegohl »

You will find it in the transform. Stage properties for the reference link.
Michael Gohl
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That's not the issue, it says you're using user-defined sql and you're not selecting the same number of columns as you've defined in the stage.
-craig

"You can never have too many knives" -- Logan Nine Fingers
mikegohl
Premium Member
Premium Member
Posts: 97
Joined: Fri Jun 13, 2003 12:50 pm
Location: Chicago
Contact:

Post by mikegohl »

Good catch. I should read the entire post.
Michael Gohl
sashah
Participant
Posts: 37
Joined: Thu May 10, 2007 3:02 pm

Post by sashah »

Hi Craig,

Thank you for your response.
I verified the number of result columns defined in the stage. They match the number of columns in the query.
Is there something else that I should verify.

Thank you
Samir
sashah
Participant
Posts: 37
Joined: Thu May 10, 2007 3:02 pm

Post by sashah »

Hi Craig,

Thank you for your response.
I verified the number of result columns defined in the stage. They match the number of columns in the query.
Is there something else that I should verify.

Thank you
Samir
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Can you post the sql you are using? That and verify that any of the columns used in the 'where' clause are marked as Key fields as well.
-craig

"You can never have too many knives" -- Logan Nine Fingers
sashah
Participant
Posts: 37
Joined: Thu May 10, 2007 3:02 pm

Post by sashah »

Hi Craig,

There are no where clauses. I am calling a function in SQL Server that is returning data.

Below is the sql from Select Account_nsp_id,BENCHMARK_nsp_id,SEQUENCE_NUM,PRIMARY_BENCHMARK from V_Account_Benchmarks('ABC',?)

Thank you for your help.

Regards
Samir
sashah
Participant
Posts: 37
Joined: Thu May 10, 2007 3:02 pm

Post by sashah »

Hi Craig,

There are no where clauses. I am calling a function in SQL Server that is returning data.

Below is the sql from Select Account_nsp_id,BENCHMARK_nsp_id,SEQUENCE_NUM,PRIMARY_BENCHMARK from V_Account_Benchmarks('ABC',?)

Thank you for your help.

Regards
Samir
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Why is there a parameter marker? Because there is an implied WHERE clause.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Is one of the four columns being selected the same column substituted in for the parameter marker? Four columns selected, four columns defined in the stage? Or five?
-craig

"You can never have too many knives" -- Logan Nine Fingers
sashah
Participant
Posts: 37
Joined: Thu May 10, 2007 3:02 pm

Post by sashah »

Yes one of the four column selected is substituted in the parameters marker. The marker is for column Account_nsp_id. 4 columns are defined in the stage.
sashah
Participant
Posts: 37
Joined: Thu May 10, 2007 3:02 pm

Post by sashah »

Yes one of the four column selected is substituted in the parameters marker. The marker is for column Account_nsp_id. 4 columns are defined in the stage.
Post Reply