Browse Prior Art Database

Utility to load xml elements

IP.com Disclosure Number: IPCOM000197257D
Publication Date: 2010-Jun-30
Document File: 2 page(s) / 75K

Publishing Venue

The IP.com Prior Art Database

Abstract

A program is disclosed that load parts of the XML documents to the specified table in the xml repository with the options provided. Limitation of load: At present, load does not give an option to extract selected data or elements from XML document and then load to tables. There is an XMLTABLE function by which it is possible to extract selected elements in a table and then it can be inserted to a relational view. Workaround steps: Application developers can go with the below mentioned approach to some extent, but this method does not work out and is very tedious while working with multiple xml documents. Create temporary table. Load entire XML file in to table t1. load from $HOME(path of .del files) xdsDir.del of del xml from $pathxml(path of xml files) xmlparse preserve whitespace insert into T1 Use XMLTABLE function to extract required elements and store it to an another table. create view UTILIZATION_TADDM_CPU as select xt.* from t1 as p,xmltable('\$Z/SMSData' passing xmlcol as Z columns TIMESTAMP integer path 'date', HOSTNAME varchar(99) path 'hostname',CPU_USED_PCT varchar(99) path 'processor_busy') as xt" create view UTILIZATION_TADDM_MEM as select xt.* from t1 as p, \ xmltable('\$Z/SMSData' passing xmlcol as Z columns TIMESTAMP integer path 'date', HOSTNAME varchar(99) path 'hostname',INUSE_PCT varchar(99) path 'memory_used_percent',MEMSIZE_MB varchar(99) path 'memory_size') as xt" Delete temporary table. Problems faced by users: Unnecessary wastage of storage by storing entire document in repository. Need to understand the usage of XMLTABLE functions and to add more elements to this function makes it very complicate. Repository contains unwanted data. No option available to work on multiple xml documents. Cannot drop the intermediate table once processing is done. Existing Load command options: CLIENT FROM filename | pipename | device | cursorname OF filetype LOBS FROM lob-pathMODIFIED BY file-type-mod METHOD XML FROM xml-path,XMLPARSE,STRIP WHITESPACE,PRESERVE WHITESPACE,XMLVALIDATE,USING XDS,USING SCHEMA schema-sqlid ,USING SCHEMALOCATION HINTS,IGNORE schema-sqlid,MAP schema-sqlid ,SAVECOUNT n,ROWCOUNT n,WARNINGCOUNT n,MESSAGES message-file ,TEMPFILES PATH temp-pathname,INSERT,REPLACE,KEEPDICTIONARY ,RESETDICTIONARY,TERMINATE,RESTART,FOR EXCEPTION table-name,NORANGEEXC ,NOUNIQUEEXC,STATISTICS USE PROFILE,STATISTICS NO,COPY NO,COPY YES,USE TSM,OPEN num-sess SESSIONS,TO device/directory,LOAD lib-name ,NONRECOVERABLE,WITHOUT PROMPTING,DATA BUFFER buffer-size,SORT BUFFER buffer-size,CPU_PARALLELISM n,DISK_PARALLELISM n,INDEXING MODE ,AUTOSELECT,REBUILD,INCREMENTAL,DEFERRED,ALLOW NO ACCESS ,ALLOW READ ACCESS,USE tablespace-name,SET INTEGRITY PENDING CASCADE ,IMMEDIATE,DEFERRED,LOCK WITH FORCE,REDIRECT,INPUT FROM,FILE input-file ,OUTPUT TO,FILE output-file,PARALLELIZE,RESTARTCOUNT,USING directory

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 55% of the total text.

Page 1 of 2

Utility to load xml elements

Utility to load xml elementsUtility to load xml elements

Implementation

Add XMLTABLE option for load command.

    XMLTABLE option will look for txt file which contains information about table column and element names.

Add file as parameter to XMLTABLE option by which it will include the column names and path of element that needs to be added.

Add level option that will break the document wrt levels and insert to different tables. (Level option can break XML documents wrt levels or hierarchy and insert into tables;

Number of tables will be the number of breaks and tables' names will be like table1,

table2 etc.).

Retain temporary table created for inserting XML documents to table.

Proposed load command options

LOAD [

-xmltable] {filename} [

Basic fetch required data and insert into a single table

load xdsdirectory xdsfilename xmldocument -xmltable t1.txt insert into t1 Basic fetch required data and insert into multiple tables

load xdsdirectory xdsfilename xmldocument -xmltable t1.txt,t2.txt insert into t1 ,t2 Advanced break document wrt levels of xmldocument and insert into tables created by the system with names starting with TABLE

load xdsdirectory xdsfilename xmldocument -xmltable -level 3 insert into TABLE Basic fetch required data and insert into multiple tables and retain the specified temporary table that is created

load xdsdirectory xdsfilename xmldocument -xmltable t1.txt,t2.txt insert into t1 ,t2

retain t1

Basic fetch required data and insert into multiple tables and retain all temporary tables that are created

load xdsdirectory xdsfilename xmldocument -xmltable t1....