String/Character Functions – translate

The Oracle/PLSQL function translate replaces a character string in a string with another specified character string. It replaces only one character at a time. Syntax: TRANSLATE( string, from_string, replace_string ) string is the string that has to be searched. from_string is the string that will be searched for in string. replace_string is the set of […]
Continue reading…

Enjoyed this post? Share it!

 
 

String/Character Functions – rtrim

The Oracle/PLSQL function rtrim removes all specified characters from the right of a string. It removes every occurrence of specified characters that are leading the string. Syntax: RTRIM(string, trim_string) string is the string from which characters have to be trimmed. trim_string is optional. It is the set of characters that will be removed from the […]
Continue reading…

Enjoyed this post? Share it!

 
 

String/Character Functions – ltrim

The Oracle/PLSQL function ltrim removes all specified characters from the left of a string. It removes every occurrence of specified characters that are leading the string. Syntax: LTRIM(string, trim_string) string is the string from which characters have to be trimmed. trim_string is optional. It is the set of characters that will be removed from the […]
Continue reading…

Enjoyed this post? Share it!

 
 

String/Character Functions – trim

The Oracle/PLSQL function trim removes the specified characters either sides of a string. Trim can be used to remove spaces(or characters) that are leading, trailing or both from the string by using the keywords trailing, leading or both. By default, trim removes from both front and end of the string. Syntax: TRIM(string) Example code: SELECT […]
Continue reading…

Enjoyed this post? Share it!

 
 

String/Character Functions – concat

The Oracle/PLSQL function concat allows you to concatenate two strings together. Syntax: CONCAT(string1, string2) string1 and string2 are to two strings to be concatenated. Example code: SELECT CONCAT(’Mad’, ‘Man’) FROM dual name ——- MadMan SELECT * FROM books SELECT book_id, CONCAT(author_id, author_name) author FROM books
Continue reading…

Enjoyed this post? Share it!

 
 

String/Character Functions – rpad

The Oracle/PLSQL function rpad pads the right-side of a string to a specified length with the specified characters. Syntax: RPAD(string, pad_length, pad_string) string is the string which has to be padded. pad_length is the return value. If the pad_length is smaller than the string, then the string will be truncated to the size of pad_length. […]
Continue reading…

Enjoyed this post? Share it!

 
 

String/Character Functions – lpad

The Oracle/PLSQL function lpad pads the left-side of a string to a specified length with the specified characters. Syntax: LPAD(string, pad_length, pad_string) string is the string which has to be padded. pad_length is the return value. If the pad_length is smaller than the string, then the string will be truncated to the size of pad_length. […]
Continue reading…

Enjoyed this post? Share it!

 
 

String/Character Functions – length

The Oracle/PLSQL function length returns an integer that is the length of the specified string. Syntax: LENGTH(string) string is the character string whose length is returned. The function returns NULL if the string is null. Example code: SELECT LENGTH(NULL) LENGTH FROM DUAL Length —— null SELECT LENGTH(’Back to the future’) LENGTH FROM dual Length ——— […]
Continue reading…

Enjoyed this post? Share it!

 
 

String/Character Functions – replace()

REPLACE SQL function is used to search for a pattern of characters and change all the instances of that pattern. It returns a string in which all occurrences of match_string in string are replaced by replace_string. If replace_string is not specified, then it removes all occurrences of the match_string. Syntax: REPLACE(string, match_string, replace_string) Example code: […]
Continue reading…

Enjoyed this post? Share it!

 
 

String/Character Functions – initcap()

The Oracle/PLSQL initcap function returns the character string with the first letter in each word in uppercase and rest of the letters in lowercase. It capitalizes only the first character of each word. Syntax: INITCAP( string_expr ) Example code: SELECT INITCAP(’this is a project’) FROM dual This returns This Is A Project SELECT INITCAP(’ALL UPPERCASE […]
Continue reading…

Enjoyed this post? Share it!

 
 

String/Character Functions – instr()

The Oracle/PLSQL function instr returns an integer which specifies the location of a substring in a string. In the syntax, the start_position and occurrence are optional. The parameter string is the string that is searched. The search_string is the string or character to search for in the string. The start_position is the position at which […]
Continue reading…

Enjoyed this post? Share it!

 
 

String/Character Functions – substr()

The Oracle/PLSQL function substr returns a substring from a string. In the syntax below, string is the source string. start_position is the position from where the substring has to be extracted. If start_position is negative, then substr starts from the end of the string and counts backwards. substring_length is optional. It is the number of […]
Continue reading…

Enjoyed this post? Share it!