Page 1 of 1

Error in assignment. SQLSTATE=22005

Posted: Thu Feb 01, 2007 12:11 am
by chirag_dg
There is a simple job.I am trying to create a Hash file. A sequential flat file is input and DB2 table as the lookup.

Director is showing me the error as :

Error in assignment. SQLSTATE=22005
SQLExecute: Error executing statement 'SELECT key1,key2,a,b,c FROM schema.table WHERE key1 = ? AND key2 = ?AND key2 in ('op1', 'op2', 'op3', 'op4')'.

Can anyone help.

Posted: Thu Feb 01, 2007 2:42 am
by ArndW
What are you datatypes for key1 and key2 and what is the datatype in your DS job with which you are filling them? For those 2 values of key1 and key2 what happens when you try to manually type in the SELECT clause from the command line and the DB2 command?

Posted: Thu Feb 01, 2007 5:28 am
by kumar_s
A quick search on SQLSTATE=22005 will should you that, its due to data type mismatch. The same reason why Arnd asking the question.
Also check if the value that been send for lookup fields (key1 and key2) are of compatiable datatype.

Posted: Thu Feb 01, 2007 7:13 am
by chirag_dg
quote="kumar_s"]A quick search on SQLSTATE=22005 will should you that, its due to data type mismatch. The same reason why Arnd asking the question.
Also check if the value that been send for lookup fields (key1 and ...[/quote]

THe job is working now. There was a problem with the source file. There was an extra french character,in the source file i.e. the corrupted dat file which was crreating problem.
Thanks.

Posted: Thu Feb 01, 2007 3:47 pm
by ray.wurlod
Are you saying that there was a French character in the source file that was passed to either key1 or key2? DataStage should have no trouble with this!

However SQL Server may require NVarChar rather than VarChar (or NChar rather than Char) and this may have engendered the data type mismatch error from SQL Server.