Page 2 of 2

Posted: Tue Jan 19, 2010 9:40 am
by suneelchallagali
Using ODBC stage i am able to insert the data into DB2 remote database but not able to insert with db2 udb stage. do i need to set any additional environment variables

Posted: Tue Jan 19, 2010 10:00 am
by chulett
Did you try removing and re-adding the stage? Impossible to tell from what you're posting. :?

Posted: Tue Jan 19, 2010 10:21 am
by suneelchallagali
Hey chulett i have replace the db2 udb stage with new one and run the job but i am getting same error

APT_CombinedOperatorController,0: Fatal Error: Fatal: This SQL statement did not contain the same number of parameters as columns on this link. This usually happens with user-defined SQL

Posted: Tue Jan 19, 2010 3:56 pm
by ray.wurlod
The only solution is GET IT RIGHT.

The SQL must refer to precisely the correct number of columns with correct (compatible) data types as are specified in the stage's metadata.

Posted: Tue Jan 19, 2010 5:11 pm
by suneelchallagali
Thank you very much for your help ray and chulett

actually when i try to run the job with auto generated sql records are loading into db2 database but when i am trying to create user define sql it is not loading. Atleast i am able to load the data. Still i am little bit confused why it is not working properly i have checked datatypes and length of the datatype for target database they all are same.

any how atleast i can load the data i am marking this issue as resolve

hopefully by soometime i will resolve the issue with user define sql

Posted: Tue Jan 19, 2010 5:20 pm
by ray.wurlod
Only you can resolve the "issue". You have created user-defined SQL that does not use the same number of columns as in your metadata.

In particular, if your SQL generates the key value (for example using a database sequence), then the key column should not appear in the metadata. The metadata (column definitions) define the number of values that will be delivered to supply values to parameter markers in the SQL.

Posted: Tue Jan 19, 2010 5:24 pm
by chulett
suneelchallagali wrote:ok chulett i wont use user define sql
suneelchallagali wrote:Hey chulett i have replace the db2 udb stage with new one and run the job but i am getting same error

APT_CombinedOperatorController,0: Fatal Error: Fatal: This SQL statement did not contain the same number of parameters as columns on this link. This usually happens with user-defined SQL
So... when this happened you were NOT using auto-generated sql as was discussed? This was from yet another user-defined attempt? :roll:

Posted: Tue Jan 19, 2010 5:29 pm
by suneelchallagali
actually i tried with both of them user define and as well as auto generated sql but i am getting the same error as you mention then i have restart the system and created the new job and selected auto generated job. then it is working fine, after that then i check with user define sql it is not working. But for now auto generated sql is working fine.