Выполнить нижеприведенную функцию.
CREATE OR REPLACE FUNCTION NUMTOWORDS (P_IN IN NUMBER)
RETURN VARCHAR2
IS
V_WORDS VARCHAR2 (20) := '';
V_CHAR VARCHAR2 (20) := '';
V_LENGTH NUMBER;
TYPE ARRAY_TYPE IS VARRAY (10) OF VARCHAR2 (10);
V_ARRAY ARRAY_TYPE := ARRAY_TYPE ('ZERO', 'ONE', 'TWO', 'THREE', 'FOUR', 'FIVE', 'SIX', 'SEVEN', 'EIGHT', 'NINE');
BEGIN
SELECT LENGTH (TO_CHAR (P_IN)) INTO V_LENGTH FROM DUAL;
FOR I IN 1 .. V_LENGTH
LOOP
V_CHAR := V_ARRAY ( (TO_NUMBER (SUBSTR (TO_CHAR (P_IN), I, 1)) + 1));
V_WORDS := CONCAT (V_WORDS, CONCAT (V_CHAR, ' '));
END LOOP;
RETURN TRIM (V_WORDS);
END;
"" ВЫБРАТЬ НОМЕРА (674) ОТ ДВОЙНОГО;