Posts

Showing posts from July, 2011

How To Extract Some Characters From A String In Oracle

Image
In Oracle SUBSTR function accepts three parameters and returns a string consisting of the number of characters extracted from the source string, beginning at the specified start position. The syntax for the SUBSTR function is: SUBSTR ( string, start_position, [ length ] ) Examples SELECT SUBSTR(‘PASSWORD’,1,4) FROM DUAL; RESULT: PASS

How to Replace a String Characters with another Set of Characters in Oracle

Image
In Oracle, REPLACE function is used to replace a sequence of characters in a string with another set of characters. The syntax for the REPLACE function is: REPLACE( string1, string_to_replace, [ replacement_string ] ) Examples: SELECT REPLACE (' PASSWORD ',' PASS ') FROM DUAL; Result: WORD