CREATE OR REPLACE FUNCTION GJUTIS.fn_GetNodeName(I_NODE_ID VARCHAR2)
  RETURN VARCHAR2 IS RESULT VARCHAR2(120);
  R_NODE_NM VARCHAR2(120);
BEGIN

    SELECT TRIM(NODE_NAME)
      INTO R_NODE_NM
      FROM TB_NODE
     WHERE NODE_ID = I_NODE_ID;

    RESULT := R_NODE_NM || '[' || I_NODE_ID || ']';

    RETURN (RESULT);

 EXCEPTION
 WHEN NO_DATA_FOUND THEN RETURN('[' || I_NODE_ID || ']');
 WHEN OTHERS THEN RETURN('[' || I_NODE_ID || ']');

END fn_GetNodeName;
