Problem with spaces in sql server

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
Ragunathan Gunasekaran
Participant
Posts: 247
Joined: Mon Jan 22, 2007 11:33 pm

Problem with spaces in sql server

Post by Ragunathan Gunasekaran »

Hi,
I have used the ISNULL function in the ODBC stage to convert null values in the sql server to spaces. This function is actually working for the columns that are actually having null values .. When i view through the query analyser not able to ascertain the coluimn value.. i gave ascii(col_name) and it returned Null.
I have used If trim(col_name) ="" then " " else col_name in datastage to capture this .. I am not sure whether this is working as i dont get spaces populated out of using this expression.....

Any clue of how to solve this
Regards
Ragu
Ragunathan Gunasekaran
Participant
Posts: 247
Joined: Mon Jan 22, 2007 11:33 pm

Post by Ragunathan Gunasekaran »

I have got an update for this issue... The prior column is a varchar2(4000) column .This column contains a "\n" characters in it . When i tried viewing data ,it shows data partially .. The data after the varchar2(4000) column is not shown... Any clue of how to remove the "\n" character in the input column.
Regards
Ragu
Ultramundane
Participant
Posts: 407
Joined: Mon Jun 27, 2005 8:54 am
Location: Walker, Michigan
Contact:

Post by Ultramundane »

Ragunathan Gunasekaran wrote:I have got an update for this issue... The prior column is a varchar2(4000) column .This column contains a "\n" characters in it . When i tried viewing data ,it shows data partially .. The data after the varchar2(4000) column is not shown... Any clue of how to remove the "\n" character in the input column.
Is this MsSQL? If so, can you just select the column with the replace function? SELECT REPLACE(your_column, CHAR(13), CHAR(32))? Or, SELECT REPLACE(your_column, 0x0D, 0x20) ?
Post Reply