APT_ORACLE_PRESERVE_BLANKS equivalent in Teradata

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
prashanth.spl
Participant
Posts: 23
Joined: Mon Jan 14, 2008 6:09 am

APT_ORACLE_PRESERVE_BLANKS equivalent in Teradata

Post by prashanth.spl »

Hi,

Is there any equivalent variable as APT_ORACLE_PRESERVE_BLANKS for Teradata database?




Thanks,
Prashanth
varaprasad
Premium Member
Premium Member
Posts: 34
Joined: Fri May 16, 2008 6:24 am

Post by varaprasad »

There is no equivalent available for Teradata. May be, not required.

In case of Oracle, the APT_ORACLE_PRESERVE_BLANKS variable affects the whitespace trimming. It is important in case of SQL*Loader, because Oracle removes the spaces and considers fields with only spaces to be NULL values.
But with Teradata, it is different. Teradata by default removes the trailing spaces for CHAR datatypes which doesn't really matter if the column definition has required length defined. Apart from that it doesn't really botch up anything.

So you have to determine why you need this.
prashanth.spl
Participant
Posts: 23
Joined: Mon Jan 14, 2008 6:09 am

Post by prashanth.spl »

I am trying to load the Teradata Table using a dataset which contains the Varchar datatypes.

In table also i have all varchar datatypes.

For Example

Table: col1 varchar(10);

Dataset: col1: 'prashanth '

While loading i want to ignore the last spaces and load to the table.

How can we achieve this?

Thanks,
Prashanth
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What do you mean by "ignore the last spaces"? :?

I'm guessing from your subject that you want to preserve the trailing space and it gets removed during the load?
-craig

"You can never have too many knives" -- Logan Nine Fingers
prashanth.spl
Participant
Posts: 23
Joined: Mon Jan 14, 2008 6:09 am

Post by prashanth.spl »

chulett,

Yes your right. spaces should be removed during load.

The data 'prashanth ' should load to the table as 'prashanth'.

How can we do this?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So actually I'm not right and the exact opposite of what I said is what you need.

Trim() or TrimB()
-craig

"You can never have too many knives" -- Logan Nine Fingers
prashanth.spl
Participant
Posts: 23
Joined: Mon Jan 14, 2008 6:09 am

Post by prashanth.spl »

chulett,

There hundrends of jobs. For each field, if we want to transfrom, then it will take so much of time. is there any similar variable as APT_ORACLE_PRESERVE_BLANKS?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Not that I am aware of... and besides, you don't want to "preserve blanks". Perhaps some Teradata experts need to weigh in here but I'd wager it works like any other database - if you send the field over with spaces in it, that's what you get. If you don't want them you need to trim them before they get that far.

AFAIK, it's only Oracle that plays this crazy automagic trimming game and decides that a field with only spaces in it is 'empty' and that an empty field is the same as a null field. Hence the special Oracle environment variable to shut that off.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Learn about "derivation substitution" in the Transformer stage - you can save yourself a lot of work.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply