Posts

Showing posts from June, 2011

How to remove characters from the right side of a text expression in Oracle

Image
In Oracle RTRIM function removes all the rightmost characters matching string from Characters. The syntax for the RTRIM function is: RTRIM(character,Removing String) For Example:

SELECT RTRIM('FOREST','EST') FROM DUAL;

Result: FOR


How to remove characters from the left side of a text expression in Oracle

Image
In Oracle LTRIM function removes all the characters matching string from the left side of Characters. The syntax for the LTRIM function is: LTRIM(character,Removing String) For Example:

SELECT LTRIM('FOREST','FOR') FROM DUAL;

Result: EST

How to insert characters in the right side of a string in oracle

Image
In Oracle, RPAD function pads the right-side of a string with a specific set of characters.The syntax for the RPAD function is: RPAD( string1, padded_length, [ pad_string ] ).

For Example

SELECT RPAD('SHAHEER',12,*****) FROM DUAL;

RESULT: SHAHEER*****


How to insert characters in the left side of a string in oracle

Image
In Oracle, LPAD function pads the left side of a string with a specific set of characters. The syntax for the LPAD function is: LPAD( string1, padded_length, [ pad_string ] ).

For example

SELECT LPAD('SHAHEER',12,'*****') FROM DUAL;

RESULT: *****SHAHEER




How to convert a string from lowercase to uppercase in oracle

Image
In Oracle, UPPER function converts all letters in the specified string to uppercase. The syntax for the UPPER function is: UPPER(string). For Example SELECT UPPER('shaheer') FROM DUAL; RESULT : SHAHEER


How to convert a string from uppercase to lowercase in oracle

Image
In Oracle, LOWER function converts all letters in the specified string to lowercase. The syntax for the LOWER function is: LOWER(string). For Example SELECT LOWER('SHAHEER') FROM DUAL; RESULT: shaheer



How to calculate length of a string in oracle

Image
In Oracle, LENGTH function returns the length of the specified string.The syntax for the LENGTH function is:LENGTH( string )

For Example

SELECT LENGTH('SHAHEER') FROM DUAL

RESULT: 7



How to convert a String first character in uppercase in oracle

Image
In Oracle INITCAP function sets the first character in each word to uppercase and the rest to lowercase. The syntax for the INITCAP function is: INITCAP(string).

For Example

SELECT INITCAP('SHAHEER') FROM DUAL;

Result: Shaheer

How to concatenate two strings in Oracle

Image
In oracle the CONCAT function allows you to concatenate two strings together. The syntax for the CONCAT function is: CONCAT(CHAR1,CHAR2) For Example SELECTCONCAT('SHAHEER','BADAR') "RESULT" FROM DUAL;


How to get value of N specified character in Oracle

Image

How to get the ASCII value of first character in Oracle

Image

Free - Open Source Version Control Software Systems

Image