Home » SQL & PL/SQL » SQL & PL/SQL » deleting char from a string
deleting char from a string [message #209395] Thu, 14 December 2006 09:44 Go to next message
Messages: 37
Registered: February 2000
Hope you can help me,
In my query I read in a string with all type of characters in it, I want to delete all characters from this string which are not equal to 0-9 or A-F
I am trying to do this with the following instruction, (this will only delete characters above F), chr(70) = F, chr(0) = Null

REPLACE(string_variable, >CHR(70), CHR(0))

For some reason it does not like the >CHR(70), any ideal how the syntax should be

Re: deleting char from a string [message #209396 is a reply to message #209395] Thu, 14 December 2006 09:57 Go to previous message
Messages: 2794
Registered: April 2006
Senior Member
You may want to use the TRANSLATE function:

TRANSLATE(upper(string_variable), ' 0123456789GHIJKLMNOPQRSTUVWXYZ', ' ')

If you ONLY want capital letters, then you can remove the upper function.

[Updated on: Thu, 14 December 2006 10:40]

Report message to a moderator

Previous Topic: How to import DUMP file to a new database?
Next Topic: Can we create new partitions in a partitioned table
Goto Forum:

Current Time: Tue Oct 25 01:50:38 CDT 2016

Total time taken to generate the page: 0.19414 seconds