Step 1 - Compile your class
public class LongConvertor {
public static String toString(String i) {
return Long.toString(Long.parseLong(i), 36);
}
}
Step 2 : Load your class on to Oracle
loadjava -user scott -password tiger LongConverter.class;
Step 3: Create a wrapper function
CREATE OR REPLACE FUNCTION LONG_TO_STRING (input VARCHAR2) RETURN VARCHAR2 AS LANGUAGE JAVA NAME 'LongConverter.toString(java.lang.String) return java.lang.String';
Step 3: Use it this way :)
SELECT UPPER(LONG_TO_STRING(10106192)) FROM DUAL;
Refer : http://docs.oracle.com...