The Function is :
CREATE OR REPLACE FUNCTION F_NAMES(V VARCHAR2) RETURN VARCHAR2 IS
VNAMES VARCHAR2(100):=' ';
BEGIN
FOR R IN 1..LENGTH(LTRIM(RTRIM(V))) LOOP
VNAMES:=VNAMES||' '||SUBSTR(V,R,1);
END LOOP;
RETURN LTRIM(RTRIM(VNAMES));
END;
/
SQL> SELECT F_NAMES('AZIZ') FROM DUAL;
F_NAMES('AZIZ')
-----------------------
A Z I Z
This is the behaviour of SUBSTR Function of Oracle SQL.
Tags:
Oracle PLSQL