Replace function
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 38
- Joined: Sat Feb 28, 2004 12:11 pm
Replace function
Hi
From source data one column is coming with carraige returns , in target table i have to replace this carriage return with spaces .is there any function like REPLACE in oracle ? Can guide me in this issue
Thanks
From source data one column is coming with carraige returns , in target table i have to replace this carriage return with spaces .is there any function like REPLACE in oracle ? Can guide me in this issue
Thanks
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Premium Member
- Posts: 892
- Joined: Thu Oct 16, 2003 5:18 am
-
- Participant
- Posts: 108
- Joined: Wed Jul 28, 2004 7:15 am
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Nah!
REPLACE replaces the value of an element in a dynamic array.
You need to use CONVERT, EREPLACE or CHANGE. CHANGE is a subset of EREPLACE functionality.
For single character replacement, CONVERT is the more efficient. However if you need portability to Windows platforms you will need EREPLACE or CHANGE, since the line terminator is two characters long.
Also, I doubt very much that the "\r" notation will work properly with the CONVERT function in server jobs, since it would replace "\" and "r" separately. Similarly, I believe EREPLACE and CHANGE would seek out explicit instances of "\r". That is, DataStage BASIC does not handle shell escapes. Specify Char(10).
All these functions can be found in the DataStage BASIC manual.
REPLACE replaces the value of an element in a dynamic array.
You need to use CONVERT, EREPLACE or CHANGE. CHANGE is a subset of EREPLACE functionality.
For single character replacement, CONVERT is the more efficient. However if you need portability to Windows platforms you will need EREPLACE or CHANGE, since the line terminator is two characters long.
Also, I doubt very much that the "\r" notation will work properly with the CONVERT function in server jobs, since it would replace "\" and "r" separately. Similarly, I believe EREPLACE and CHANGE would seek out explicit instances of "\r". That is, DataStage BASIC does not handle shell escapes. Specify Char(10).
All these functions can be found in the DataStage BASIC manual.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Yes, yes, I know, not sure what I was thinking... 'fewer' for things that can be counted individually, and 'less' for those things that can't be. Mostly. I'd edit my original post but it would ruin the whole Feng Shui of it.ray.wurlod wrote:Fewer.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers