Posts Tagged ‘Arabic Number’

Function To Convert Number To Arabic Number

April 28th, 2019, posted in Oracle Queries
Share
Function To Convert Number To Arabic Number,Arabic Number,English Arabic Number,Oracle Numbers,Oracle DBA,Oracle Apps DBA,Oracle Coding,Oracle Arabic Number Query
FUNCTION convert_to_arabic (p_input IN VARCHAR2, p_msg OUT VARCHAR2)
    RETURN VARCHAR2
    IS
    --

    l_output VARCHAR2(20) DEFAULT NULL;
    CURSOR csr_convert (cp_value VARCHAR2)

    IS

    SELECT TRANSLATE (cp_value,'0123456789',

                         UNISTR ('\0660')
                      || UNISTR ('\0661')
                      || UNISTR ('\0662')
                      || UNISTR ('\0663')
                      || UNISTR ('\0664')
                      || UNISTR ('\0665')
                      || UNISTR ('\0666')
                      || UNISTR ('\0667')
                      || UNISTR ('\0668')
                      || UNISTR ('\0669')
                    ) arabic_numerals
       FROM DUAL;

    BEGIN


    IF p_input IS NOT NULL THEN

      
        OPEN csr_convert(p_input);
        FETCH csr_convert INTO l_output;
        CLOSE csr_convert;

    END IF;

    RETURN l_output;
    EXCEPTION     
    WHEN OTHERS THEN
        IF csr_convert%ISOPEN THEN
            CLOSE csr_convert;

        END IF;
      
       p_msg := SUBSTR(SQLERRM,1,200);
       RETURN l_output;
    END convert_to_arabic;

 

Share