Page 1 of 1

single quote vs double quote

Posted: Wed Jan 25, 2012 3:41 pm
by pratapsriram
Is there any difference between a single quote to a double quote when defining a value in parallel job transformer stage?
I am trying to do null handling for a lookup value by assigning it to '-1 ' which has a space character in the string, but the records always get rejected while loading due to the foreign constraint saying it didnt find the parent key. The parent key is a char(3) of value '-1 '. So how to do this in Datastage?

Posted: Wed Jan 25, 2012 4:13 pm
by qt_ky
I don't think the type of quote matters.

Have you tried dumping the records to the Peek stage, or a Sequential File stage, instead of loading them into a table? Then you can see what's actually in there.

What error message do you get?

How are you handling the nulls? What have you tried?

Posted: Wed Jan 25, 2012 11:25 pm
by BugFree
Hi,

I will make some assumptions before suggesting something.

----I assume that the 'Parent Key' is having referential integrity on the primary key of the same table. So, both fields reside in same table.
----"-1" is the place holder value that you are trying pass incase of NULL\Space.

If my assumptions are right then,
--- You should insert a record where primary key value is "-1" and Parent Key is NULL. This should happen before loading any of the other valid record. I assume that your primary or parent key is integer in nature, you should enclose -1 in double quote or single qoute.
--- Try loading other valid records.

Hope this helps

Posted: Wed Jan 25, 2012 11:34 pm
by BugFree
Hi,

The same logic applies even if Parent key is having referencial integrety on different table.

The point is -1 should be made available in the table before you load actual record.

Posted: Thu Jan 26, 2012 6:23 am
by prakash.dasika
If one value is defined as char(3) then the other corresponding value in lookup should have the same data type. are you sure the value after -1 is a space?, it might be a unprintable character.