CREATE OR REPLACE FUNCTION GET_WS_DIC_VALUE(dcode IN VARCHAR2) RETURN VARCHAR2 as dname VARCHAR2(200); BEGIN SELECT NAME INTO dname from PSN_WS_DIC_RELATED_RANGE WHERE code = dcode; RETURN dname; EXCEPTION WHEN no_data_found THEN RETURN ''; END GET_WS_DIC_VALUE;