ODBC Source- incorrect number of result columns.
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 17
- Joined: Tue Apr 11, 2006 2:35 pm
ODBC Source- incorrect number of result columns.
Hi,
In one of my ODBC sources am having an user defined SQL Query with a group by clause in it.
Inspite of the source definition having all the columns required the job fails giving the following error message :
"SQL statement has incorrect number of result columns"
The sql works fine and am also able to view data in the source stage...
Any Idea whats happening??
~
Deepak
In one of my ODBC sources am having an user defined SQL Query with a group by clause in it.
Inspite of the source definition having all the columns required the job fails giving the following error message :
"SQL statement has incorrect number of result columns"
The sql works fine and am also able to view data in the source stage...
Any Idea whats happening??
~
Deepak
Deepak
-
- Participant
- Posts: 17
- Joined: Tue Apr 11, 2006 2:35 pm
I know you're new here, so welcome aboard. Please post your exact SQL because soooo many times the "just like this SQL" isn't just like the SQL.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
-
- Participant
- Posts: 17
- Joined: Tue Apr 11, 2006 2:35 pm
-
- Participant
- Posts: 17
- Joined: Tue Apr 11, 2006 2:35 pm
You should try recreating the job using just ODBC-->XFM-->SEQ. If you're on DS 5, there could be something flaky where the job isn't correctly put together underneath the covers.
You don't need to use the "as sum_salary" because DS doesn't care. It runs the query as a cursor and just reads from the cursor. Columns are positional in nature, so when using user-defined SQL you must make sure datatypes, size, and scale match your definitions.
The group by shouldn't be an issue. If you switched your SQL back to generated and just streamed out the data, does it work still?
You don't need to use the "as sum_salary" because DS doesn't care. It runs the query as a cursor and just reads from the cursor. Columns are positional in nature, so when using user-defined SQL you must make sure datatypes, size, and scale match your definitions.
The group by shouldn't be an issue. If you switched your SQL back to generated and just streamed out the data, does it work still?
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Hmmm, that shouldn't have made any difference. With generated SQL, that matters because it is writing the query for you and would add a GROUP BY clause with your columns. You would also have to put something into the DERIVATION column to MIN/MAX/SUM/COUNT/etc the non-grouping columns.
It sounds like somehow your query was generated and not user-defined.
It sounds like somehow your query was generated and not user-defined.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
-
- Participant
- Posts: 17
- Joined: Tue Apr 11, 2006 2:35 pm
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 17
- Joined: Tue Apr 11, 2006 2:35 pm
No the other table just has the 3 key columns.....
the job is working now....but then i dont know what exactly the problem was.....
As it was just a group by clause .... i changed the query to a generated query and added the sum clause in the derivation as suggested by one of the responses above...and it worked fine....
but iam still not sure why it did not work when i used a user defined query which was exactly the same......
Thanx for the help
the job is working now....but then i dont know what exactly the problem was.....
As it was just a group by clause .... i changed the query to a generated query and added the sum clause in the derivation as suggested by one of the responses above...and it worked fine....
but iam still not sure why it did not work when i used a user defined query which was exactly the same......
Thanx for the help
Deepak