Oracle Technology Network (OTN) > Downloads, Discussions, and Documentation for Developers and DBAs
| ORACLE.COM TECHNOLOGY NETWORK PARTNERS STORE SUPPORT |

PRODUCT CENTERS
Database Application Server JDeveloper Developer Suite Enterprise Manager Applications Technology Collaboration Suite More...
TECHNOLOGY CENTERS
BI & Data Warehousing Grid Java Developer Linux .NET Developer PHP Developer Security Service-Oriented Architecture Windows XML More...
COMMUNITY
About OTN Oracle ACEs Oracle's OTN TechBlog TechBlast Newsletter Oracle Magazine Blogs & Opinion Podcasts User Groups Partner White Papers Oracle 10g Books More...
Downloads | Documentation | Discussion Forums | Articles | Sample Code | Training | RSS | Resources For
Code Listing 7: Updating or creating the XML document
    --Note that the global package variable g_sml_ns contains
    --namespace URI: 'xmlns="http://www.decode.com/schemas/sml/2"'
    procedure hlq_ins_survey_xml(p_xml in out nocopy clob)
    is
    	v_result          boolean;
    	v_xml             xmltype := xmltype.createxml(p_xml);
    	v_survey_code     varchar2(20);
    	v_language_code   varchar2(5);
    	v_dockey          hlq_dockey_ty;
    begin
      v_survey_code   := v_xml.extract('/sml/survey/@code',g_sml_ns).getStringVal();
      v_language_code := v_xml.extract('/sml/survey/@language',g_sml_ns).getStringVal();

      v_dockey := hlq_dockey.hlq_get_survey_dockey(v_survey_code,v_language_code);

      if (v_dockey is null) then
        v_result := dbms_xdb.createResource(hlq_path.hlq_get_survey_path
                                        (v_survey_code, v_language_code)
                                        ,v_xml);
        else
    	update hlq_survey_xml_dtb x
    	set value(x) = v_xml
    	where rowid = v_dockey.get_xdb_rowid
    	;
      end;
    end;

E-mail this page
Printer View