Character-Manipulative Functions

Character-Manipulative Functions
Written by shohal

Character-Manipulative Functions

Character-Manipulative Functions (CONCAT, LENGTH, SUBSTR, INSTR, LPAD, RPAD, TRIM and REPLACE)

These functions manipulate character strings: Function. Result. CONCAT( Hello , World ) HelloWorld. SUBSTR( HelloWorld ,1,5) Hello. LENGTH( HelloWorld ) 10. INSTR( HelloWorld , W ) 6. LPAD(salary,10, ) RPAD(salary, 10, ) 24000 REPLACE ( JACK and JUE , J , BL ) BLACK and BLUE. CONCAT, SUBSTR, LENGTH, INSTR, LPAD, RPAD, and TRIM are the character-manipulation functions that are covered in this lesson. CONCAT: Joins values together (You are limited to using two parameters with CONCAT.) SUBSTR: Extracts a string of determined length. LENGTH: Shows the length of a string as a numeric value. INSTR: Finds the numeric position of a named character. LPAD: Returns an expression left-padded to the length of n characters with a character expression. RPAD: Returns an expression right-padded to the length of n characters with a character expression. TRIM: Trims leading or trailing characters (or both) from a character string (If trim_character or trim_source is a character literal, you must enclose it within single quotation marks.) Note: You can use functions such as UPPER and LOWER with ampersand substitution. For example, use UPPER( &job_title )so that the user does not have to enter the job title in a specific case. TRIM( H FROM HelloWorld ) elloWorld. Oracle Database: SQL Fundamentals I

About the author


Leave a Comment