Page 1 of 1

oracle padding spaces at the end

Posted: Fri Jun 27, 2008 2:01 pm
by peddidsx
Hi All,

I have an attribute called country_name of varchar2(50). I am using a below logic in my transofrmer:

If state = 'aa' Then 'Other' Else 'US' but the data is getting loaded as US with 48 spaces. Oracle padding the spaces at the end.

I checked APT_ORACLE_PRESERVE_BLANKS is set to false but still it is appending spaces.

I am using upsert mode and insert script in user defined sql.

Kindly pass an information to me.

Thanks
Madhu

Posted: Fri Jun 27, 2008 3:21 pm
by richdhan
Hi,

Use the APT_STRING_PADCHAR environment variable with 0x20 in the job parameters and run the job. Let us know if that resolves the issue.

HTH
--Rich

Posted: Tue Jul 01, 2008 8:38 am
by peddidsx
Hi,

I kept the string_padchar value to 0x20, but still the spaces are padding at the end. Eventhough i am hardcoding the value as "US" for country name, but somehow the oracle is taking the full lenght and adding 28 spaces at the end.

I couldn't able to find what is the problem.

Thanks
Rajesh

Posted: Tue Jul 01, 2008 4:18 pm
by ray.wurlod
If you use a Sequential File stage do you still get the padding? If not, dare I suggest that it is Oracle, rather than DataStage, that is padding the strings? Get the DBA to trace a few rows of the data being inserted.

Posted: Tue Jul 01, 2008 6:39 pm
by keshav0307
in the transformer stage, what is the column type defined for this field.

use user define insert and update query and trim the input columns