How to Inset Space as value in the Oracle table

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
Akumar1
Participant
Posts: 48
Joined: Tue May 22, 2007 3:38 am
Location: bangalore
Contact:

How to Inset Space as value in the Oracle table

Post by Akumar1 »

Hi,
Actually we are trying to insert space value in the oracle table, but it is taking as null only.
Let me explain the issue:

We have our source as flat file which has a string column (Status varchar2 (5)) which is coming with spaces as value for some of the record, see the below example:
And I need to populate Space as it value in the oracle table as well, eventually it's not happening, in fact it is inserting the record as NULL only.

Example:
Source file:

First_Name,SSN_ID,Status
Albert,1324355,True
Martin,2456788,
James,7869899,True
Selven,2543635,
Sam,234546354,False



**Actual Output**

When I run my Datastage job it run successfully, but when I do a select query in the table:

Select * from <<tablename>> where Status is null;
<<it is resulting 2 record as NULL >>
Martin 2456788
Selven 2543635

**Expected Output**
Ideally it should not return any record with null
But I am expecting its total Length to be populated as it's VALUE
Martin 2456788 <space as it value>
Selven 2543635 <space as it value>
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

What method are you using to load to Oracle? See about setting "APT_ORACLE_PRESERVE_BLANKS" to change the load behaviour on spaces.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That's pretty common Oracle behaviour in that situation and as Arnd notes, you can use that $APT variable to override it.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Akumar1
Participant
Posts: 48
Joined: Tue May 22, 2007 3:38 am
Location: bangalore
Contact:

How to Inset Space as value in the Oracle table

Post by Akumar1 »

chulett wrote:That's pretty common Oracle behaviour in that situation and as Arnd notes, you can use that $APT variable to override it. ...
All,
It worked,
thanks Again!!
Post Reply