Code Listing 6: Creating a function that wraps the document object type

function hlq_get_survey_dockey(p_survey_code varchar2, p_language_code varchar2)
    return hlq_dockey_ty
    is
	cursor c_sel(b_survey_code varchar2, b_language_code varchar2)
	is 
	select hlq_dockey_ty(lnk.survey_xdburi, lnk.survey_dtb_rowid, ref(x)) dockey        
	from   hlq_survey_link_tb lnk, hlq_survey_xml_dtb x
	where  lnk.survey_code = b_survey_code
	and    lnk.language_code = b_language_code
	and    lnk.survey_dtb_rowid = x.rowid;

	v_dockey  hlq_dockey_ty := null;
  begin
	for r_sel in c_sel(p_survey_code,p_language_code) 
        loop
	    v_dockey := r_sel.dockey;
	    exit;
	end loop;

	return v_dockey;
  end;

E-mail this page
Printer View Printer View
Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy