DECLARE
STR VARCHAR2(200) := '&FULLNAME';
L NUMBER;
N NUMBER;
S VARCHAR2(200);
TEMP VARCHAR2(200) := STR || ' ';
T VARCHAR2(200);
BEGIN
N := 0;
LOOP
L := INSTR(TEMP, ' ');
EXIT WHEN NVL(L, 0) = 0;
T := SUBSTR(TEMP, 1, L - 1);
IF N > 1 THEN
S := S || SUBSTR(TEMP, 1, 1);
T := S;
ELSIF N = 1 AND LENGTH(T) = 1 THEN
T := REPLACE(TEMP, ' ', '');
DBMS_OUTPUT.PUT_LINE(T);
RETURN;
ELSE
DBMS_OUTPUT.PUT_LINE(T);
END IF;
TEMP := SUBSTR(TEMP, L + 1);
N := N + 1;
END LOOP;
DBMS_OUTPUT.PUT_LINE(T);
END;
STR VARCHAR2(200) := '&FULLNAME';
L NUMBER;
N NUMBER;
S VARCHAR2(200);
TEMP VARCHAR2(200) := STR || ' ';
T VARCHAR2(200);
BEGIN
N := 0;
LOOP
L := INSTR(TEMP, ' ');
EXIT WHEN NVL(L, 0) = 0;
T := SUBSTR(TEMP, 1, L - 1);
IF N > 1 THEN
S := S || SUBSTR(TEMP, 1, 1);
T := S;
ELSIF N = 1 AND LENGTH(T) = 1 THEN
T := REPLACE(TEMP, ' ', '');
DBMS_OUTPUT.PUT_LINE(T);
RETURN;
ELSE
DBMS_OUTPUT.PUT_LINE(T);
END IF;
TEMP := SUBSTR(TEMP, L + 1);
N := N + 1;
END LOOP;
DBMS_OUTPUT.PUT_LINE(T);
END;
No comments:
Post a Comment