How to create string with GAP (Oracle PLSQL Function)

 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.



Muhammad Abdullah Al Noor

Muhammad Abdullah Al Noor, An Oracle Apex Consultants and founder of Noors Technology (www.noorstech.com). Core Expertise : Database Administration, Oracle Forms and Reports Development, Oracle Apex Application Designer and Development, Linux Professional etc. Also the owner of TrainerBD Training and OraDemy E-Learning. WhatsApp +8801790721177

Post a Comment

Previous Post Next Post