Saturday, February 15, 2014

Get Node value from Transaction Document using HR_XML_UTIL

CREATE OR REPLACE FUNCTION get_xml_node_value_f (
   p_transaction_id       IN NUMBER,
   p_desired_node_value   IN VARCHAR2,
   p_xpath                IN VARCHAR2,
   p_eo_name              IN VARCHAR DEFAULT NULL)
   RETURN VARCHAR2
AS
   l_xml_node_value   VARCHAR2 (32767) := NULL;
BEGIN
   l_xml_node_value :=
      apps.hr_xml_util.
       get_node_value (p_transaction_id       => p_transaction_id,
                       p_desired_node_value   => p_desired_node_value,
                       p_xpath                => p_xpath,
                       p_eo_name              => p_eo_name);
   RETURN l_xml_node_value;
EXCEPTION
   WHEN OTHERS
   THEN
      RETURN NULL;

END get_xml_node_value_f;


Example on how to Extract Value:
select get_xml_node_value_f(106003,'DateEnd','//PerAbsenceAttendancesEORow') from dual

No comments:

Post a Comment