Thursday, June 24, 2010

Trim Example In Oracle PL/SQL

Trim Character
SELECT TRIM('A' FROM 'AAAHAI') FROM DUAL;
OUTPUT:
HAI

Trim Space
SELECT TRIM(' ' FROM 'I AM THIYAGARAAJ') FROM DUAL;
OUTPUT:
I AM THIYAGARAAJ

Trim Character
SELECT TRIM('A' FROM 'AAI AM THIYAGARAAJAAAA') FROM DUAL;
OUTPUT:
I AM THIYAGARAAJ

Trim Space
SELECT TRIM(' ' FROM '        I AM THIYAGARAAJ   ') FROM DUAL;
OUTPUT:
I AM THIYAGARAAJ

No comments: