Loading nested XML file to a table
Hi I have the following XML code.-< protocols >
-Protocol of <>
< name > SampleAddition_Outer < / name >
< revision > 0 < / revision >
-< ProtocolSteps >
-< ProtocolStep >
< name > SampleAddition < / name >
< EnumProtocolStep > SampleAddition < / EnumProtocolStep >
SampleProbe < action > < / Action >
-< ParameterList >
< string > SampleDispVol < / string >
< string > SampleOverAspVol < / string >
< string > LeadAirGap < / string >
< string > TrailAirGap < / string >
< string > SPPumpAspSpeed < / string >
< string > SPPumpDispSpeed < / string >
< string > SPPumpDispHeight < / string >
< / ParameterList >
< IntAction > 0 < / IntAction >
< IntProtocolStep > 0 < / IntProtocolStep >
< SequenceName > EmptySequence < / SequenceName >
< / ProtocolStep >
< / ProtocolSteps >
This XML file is repeated over and over again in the large file.
This is a nested structure and I want to store in a table so that the columns as follows
Nom_protocole = SampleAddition_Outer, review = 0, ProtocolStep_Name = SampleAddition, EnumProtocolStep = SampleAddition, SampleProbe = Action, ParameterList is SampleDispVol
Nom_protocole = SampleAddition_Outer, review = 0, ProtocolStep_Name = SampleAddition, EnumProtocolStep = SampleAddition, SampleProbe = Action, ParameterList is SampleOverAspVol
Nom_protocole = SampleAddition_Outer, review = 0, ProtocolStep_Name = SampleAddition, EnumProtocolStep = SampleAddition, SampleProbe = Action, ParameterList is LeadAirGap
Nom_protocole = SampleAddition_Outer, review = 0, ProtocolStep_Name = SampleAddition, EnumProtocolStep = SampleAddition, SampleProbe = Action, ParameterList is TrailAirGap
Nom_protocole = SampleAddition_Outer, review = 0, ProtocolStep_Name = SampleAddition, EnumProtocolStep = SampleAddition, SampleProbe = Action, ParameterList is SPPumpAspSpeed
Nom_protocole = SampleAddition_Outer, review = 0, ProtocolStep_Name = SampleAddition, EnumProtocolStep = SampleAddition, SampleProbe = Action, ParameterList is SPPumpDispSpeed
Nom_protocole = SampleAddition_Outer, review = 0, ProtocolStep_Name = SampleAddition, EnumProtocolStep = SampleAddition, SampleProbe = Action, ParameterList is SPPumpDispHeight
I understand that this table would be very standard but its OK for me now.
I use oracle 10g.
I loaded the entire xml in the unique xmltype column and used the following query to retrieve it.
Select extractvalue (value (x), ' / Protocol/Name ") Nom_protocole,.
ExtractValue (value (x), ' / ProtocolSteps/protocol/name of the Protocol / ") protocolstep_name
of gt_xmltype_tab1 gt, TABLE (XMLSequence (extract (gt.xmlfile1, ' / Protocols/Protocol/ProtocolSettings '))) x;
But it shows only Nom_protocole in the output. There is no error in the execution, but the output is not good either.
I use Oracle 10 g
Could someone help out here?
If I understand correctly, you have three levels unnest here, so you need three nested XMLSequence:
SQL> create table tmp_xml of xmltype;
Table created
SQL>
SQL> insert into tmp_xml values(
2 xmltype(
3 '
4
5 SampleAddition_Outer
6 0
7
8
9 SampleAddition
10 SampleAddition
11 SampleProbe
12
13 SampleDispVol
14 SampleOverAspVol
15 LeadAirGap
16 TrailAirGap
17 SPPumpAspSpeed
18 SPPumpDispSpeed
19 SPPumpDispHeight
20
21 0
22 0
23 EmptySequence
24
25
26
27 ')
28 );
1 row inserted
SQL>
SQL> select extractValue(value(x1), '/Protocol/Name') as Protocol_Name
2 , extractValue(value(x1), '/Protocol/Revision') as Revision
3 , extractValue(value(x2), '/ProtocolStep/Name') as ProtocolStep_Name
4 , extractValue(value(x2), '/ProtocolStep/EnumProtocolStep') as EnumProtocolStep
5 , extractValue(value(x2), '/ProtocolStep/Action') as Action
6 , extractValue(value(x3), '/string') as ParameterList
7 from tmp_xml t
8 , table(xmlsequence(extract(t.object_value, '/Protocols/Protocol'))) x1
9 , table(xmlsequence(extract(value(x1), '/Protocol/ProtocolSteps/ProtocolStep'))) x2
10 , table(xmlsequence(extract(value(x2), '/ProtocolStep/ParameterList/string'))) x3
11 ;
PROTOCOL_NAME REVISION PROTOCOLSTEP_NAME ENUMPROTOCOLSTEP ACTION PARAMETERLIST
------------------------- ---------- ------------------ ------------------ -------------- -------------------
SampleAddition_Outer 0 SampleAddition SampleAddition SampleProbe SampleDispVol
SampleAddition_Outer 0 SampleAddition SampleAddition SampleProbe SampleOverAspVol
SampleAddition_Outer 0 SampleAddition SampleAddition SampleProbe LeadAirGap
SampleAddition_Outer 0 SampleAddition SampleAddition SampleProbe TrailAirGap
SampleAddition_Outer 0 SampleAddition SampleAddition SampleProbe SPPumpAspSpeed
SampleAddition_Outer 0 SampleAddition SampleAddition SampleProbe SPPumpDispSpeed
SampleAddition_Outer 0 SampleAddition SampleAddition SampleProbe SPPumpDispHeight
7 rows selected
Assuming you're on 10.2 you can use XMLTable as well, easier to implement IMO, but on a large XML document may not perform as well as XMLSequence if the XMLType table is not based on a schema.
Major improvements in the treatment of the XQuery were made from 11 g when using tables not based on a schema.
Tags: Database
Similar Questions
-
Load the XML file into oracle using sql loader
Hello
I'm trying to load an xml file into a table using sqlldr.
I have a table as follows:
I have a control file that I know is perfectly false:CREATE TABLE xmlloadtable ( id number, data_xml XMLType ) XmlType data_xml STORE AS CLOB;
I googled for the file control and tried in different ways, but of no use.LOAD DATA INFILE '/home/oraread/' INTO TABLE xmlloadtable ( id, data_xml )
I want to load the entire xml file into the table.
Can someone help me with the correct control file. Any help is appreciated!Try this
LOAD DATA INFILE '/home/oraread/' INTO TABLE xmlloadtable (id, file_name filler, data_xml lobfile(file_name) terminated by eof )
You can add the file as a column name field to your table between the id and xml column and remove the word to fill in the .ldr file if you need to keep the name of the file
-
load the xml file into a database to help table of travel point
Hello
Someone help me please with a possible approach. I have an interface for APEX users where users can download a file xml in apex table wwv_flow_files using the element to browse with a button "submit". Now, after loading the xml file in the wwv_flow_files table. I need to read and load the xml data into a table sample_tbl. I'm using the version of Oracle APEX 4.0 and Oracle 10 g R2 database. Here is an example of XML file to load. Please help me possible suggestions.
<? XML version = "1.0" encoding = "UTF-8"? >
< dataroot generated =... >
< MySample >
< KeyId > 1234 < / KeyId >
eddskc < KeyName > < / KeyName >
< scheduleDate > 2013-06-16T 00: 00:00 < / ScheduleDate >
< StartTime > 2013-06-16T 08: 00:00 < / StartTime >
< EndTime > 2013-06-16T 08:30:00 < / EndTime >
< / MySample >
< MySample >
< KeyId > 5678 < / KeyId >
jppdf < KeyName > < / KeyName >
< scheduleDate > 2013-05-19T 00: 00:00 < / ScheduleDate >
< StartTime > 2013-05-19T 08: 00:00 < / StartTime >
< EndTime > 2013-05-19T 08:30:00 < / EndTime >
< / MySample >
< / dataroot >
Thanks in advance.
Thank you
Orton
orton607 wrote:
My sample_tbl has a start_time field and its data type DATE.
Good. Be sure to always store dates as the DATE.
The application (in this case, APEX) needs to format the date date type in the appropriate human-readable format.
The problem with the incoming data is the 't'. You will need to convert a space using REPLACE() in the framework so that your SELECT statement
From there on, conversion to the DATE data type is simply
to_date( replace( start_time_str, 'T', ' '), 'YYYY-MM-DD HH24:MI:SS') as start_time
And, just in case where, the conversion of DATE for the desired format:
to_char( start_time, 'MM/DD/YYYY HH12:MI:SS AM')
Although, I'm 'hours' as being left-padded with zeros... Am I looking for how / if you can get rid of the zero prefix (0).
-
[Database Toolbox] possibility to Load From xml file in Labview and then in the database
Before you write in my database, I want to save it and reload if the user wants to cancel the new charge that can last several minutes.
If he cancels the load I get back my previous database data.
I managed to save my database in XML through the "DB tools SaveRecordSet To File" VI. This VI records directly contains my database table in the xml file. And finally, I only if the other VI to load file will do the same thing, means load the file and save it in my database but it gives just a recordset in labview.
Question: is it possible just to load the xml file into the database directly through Labview?
Why, finally, these screws do not have the same behavior?
I don't know, but I just thought I would chime, that if you fail to do with LabvIEW, you might want to look by making your writing in a 'Transaction' database, if your DBM takes in charge (most except MS Access)
-
Load the XML file into oracle DB using OWB
Hi friends,
I'm new XML data.
I had a requirememnt to load the xml file into an oracle table.
Can someone procedure to load the data.
Thanks in advancesee this
http://blogs.Oracle.com/warehousebuilder/2007/09/leveraging_xdb.html
-
How to load an XML file and save it as a file fm
Hi Experts,
I have a bunch of XML files in a folder. I want to make is that I want iteratively, load the xml using a StructuredApplication and save it as a file FM. I was able to sucessfully load the XML file, but I'm having trouble to save a file of FM.
Here is the code I wrote so far:
If (sourceFolder! = null) {/ / If a valid file is selected}
files = new Array();
fileType = "*.xml";
files = sourceFolder.getFiles (fileType); Download all the files that match the pattern
If (files.length > 0) {/ / get the destination to save the files}
destFolder = Folder.selectDialog ('Select the folder where you want to save the converted XML files.', ' ~');
for (var i = 0; i < files.length; i ++) {}
Set the options to open the XML file.
var openParams = GetOpenDefaultParams();
var j = GetPropIndex (openParams, Constants.FS_OpenAsType);
. propVal.ival openParams [j] = Constants.FV_TYPE_XML;
j = GetPropIndex (openParams, Constants.FS_StructuredOpenApplication);
. propVal.sval openParams [j] = "XML Snpsbook";
j = GetPropIndex (openParams, Constants.FS_FileIsOldVersion);
. propVal.ival openParams [j] = Constants.FV_DoOK;
j = GetPropIndex (openParams, Constants.FS_FontNotFoundInDoc);
. propVal.ival openParams [j] = Constants.FV_DoOK;
j = GetPropIndex (openParams, Constants.FS_FileIsInUse);
. propVal.ival openParams [j] = Constants.FV_DoCancel;
j = GetPropIndex (openParams, Constants.FS_AlertUserAboutFailure);
. propVal.ival openParams [j] = Constants.FV_DoCancel;
var returnParams = new PropVals();
I'M NOT ABLE TO GET THIS LINE TO RUN. sourceDoc RETURNS a REFERENCE of OBJECT INVALID.
sourceDoc = Open (files [i] .name, openParams, returnParams); Returns the document object
Alert (SourceDoc.Name);
Function to save. XML file. Extension of the FM
var saveParams = GetSaveDefaultParams();
var returnParamsp = new PropVals();
Change the extension .xml FM
var k = GetPropIndex (saveParams, Constants.FS_FileType);
saveParams [k].propVal.ival = Constants.FV_SaveFmtBinary;
saveAsName = sourceDoc.name.replace (/ \.) [ ^\.\\]+$/,".fm");
var saveInFile = record (saveAsName, saveParams, returnParamsp); Save as file FM
saveInFile = new file (destFolder + ' / ' + targetFile);
saveInFile.close (); Close file
}
Alert ("the files are saved in the FM to ' + destFolder");
} else {}
Alert ('no matching files found!');
}
}
Hi reda,.
You are very close, but there are a few critical flaws in your code that will prevent the proper functioning:
-Your paths in string literals must have sequences to escape the backslashes. A backslash character is treated as an adverb in an escape sequence, so those need to be escaped themselves. For example: "C:\\Users\\rajrev\\file.xml."
-Your OpenXMLFile () function does not return anything, then the original DocumentSource variable never gets made.
-It is better to use the ObjectValid() method to test a valid object of FM.
-I am not an expert of regular expression, but I can't understand the logic in your replace() method, to create the new path of the file. In addition, the property "name" of the fileObject is invalid, it must be 'name '. I think that there are simpler ways to do.
-Your call to the Save() method is incorrect. It should be fileObject.Save (saveAsName, saveParams, returnParamsp).
All that being said, here is a quick review, without comment, that works for me:
var sourceDoc = openXmlFile("C:\\Users\\rajrev\\file.xml","XML snpsbook"); if (sourceDoc.ObjectValid()) { var path = sourceDoc.Name; var filename = path.substring((path.lastIndexOf("\\") + 1), path.length); filename = filename.replace(".xml", ".fm"); path = path.substring(0, (path.lastIndexOf("\\") + 1)); path = path + "transformed_files\\" + filename; //path testing //alert(path); saveToFm(sourceDoc, path); sourceDoc.Close(0); } // Function to open and XML file function openXmlFile(filePath, structApp) { var openParams = GetOpenDefaultParams(); var i = GetPropIndex(openParams, Constants.FS_OpenAsType); openParams[i].propVal.ival = Constants.FV_TYPE_XML; i = GetPropIndex(openParams, Constants.FS_StructuredOpenApplication); openParams[i].propVal.sval = structApp; var returnParams = new PropVals(); var doc = Open(filePath, openParams, returnParams); return doc; } //Function to save the opened XML as an FM file function saveToFm(fileObject, savePath) { var saveParams = GetSaveDefaultParams(); var i = GetPropIndex(saveParams, Constants.FS_FileType); saveParams[i].propVal.ival = Constants.FV_SaveFmtBinary; var saveAsName = savePath; var returnParamsp = new PropVals(); fileObject.Save(saveAsName, saveParams, returnParamsp); }
-
shipment value of the PHP variable to Flash to load an xml file
I would like to load an XML file to the local location or on the server to ignore the name of the file. I use PHP to send the name of the Flash file.
Here it is the PHP code:
<? PHP
filesInDir ('C:\Documents and Settings\457305\My Documents\shrikant\Flash Tutorials\webassist');
function filesInDir ($tdir)
{
$dirs = rewinddir(3) ($tdir);
foreach ($dirs as $file)
{
If (($file == '.') |) ($file == '..'))
{
}
else if (is_dir ($tdir. » /'. $file))
{
filesInDir ($tdir. » /'. $file);
}
on the other
{
echo "fileName = $file";
}
}
}
? >
And here is the Actionscript code loading:
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.events.Event;
to import flash.net.URLVariables;
Stop();
Set the PHP file to load
var phpFile:String = " " http://localhost/WebAssist/test.php ";
var cons_xml:XML;
var xmlLoader:URLLoader = new URLLoader();
Specify the property dataFormat of the URLLoader to be "VARIABLE".
This ensures the variables loaded into Flash with the same variable names
xmlLoader.dataFormat = pouvez;
xmlLoader.load (new URLRequest (phpFile));
xmlLoader.addEventListener (Event.COMPLETE, processXML);
function processXML(evt:Event):void
{
trace (evt. Target.Data.FileName);
cons_xml = new XML (evt.target.data.fileName);
gotoAndPlay (2);
}
When I trace evt.target.data it displays "fileName = mainOpenEndedXML % 2Exml" and when I trace evt.target.data.fileName the file name is correctly displayed as 'mainOpenEndedXML.xml'.
But in the two next lines where the loading is done that it does not load the file IE does not play the SWF to an xml file.
I've searched the Internet to find answers, but not able to find solutions.
Loading works fine if I insert the xml file directly in the code and the SWF in the XML file plays correctly. Here it is the code for the same thing:
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.events.Event;
to import flash.net.URLVariables;
Stop();
var cons_xml:XML;
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.load (new URLRequest ("mainOpenEndedXML.xml"));
xmlLoader.addEventListener (Event.COMPLETE, processXML);
function processXML(evt:Event):void
{
cons_xml = new XML (evt.target.data);
gotoAndPlay (2);
}
Any help on this would be greatly appreciated
You said you use PHP to send the name of the Flash file. If the php file you provide only the name of the xml file that you need to load, then you will have to load the xml file in the same way that you show in your last set of code where you say that load you it directly.
-
Load a CSV file into a table like in dataworkshop
Workshop of data has a function to load a CSV file and create a table based on it, the same, I want to create in my application.
I went through the forum http://forums.oracle.com/forums/thread.jspa?threadID=334988 & start = 60 & tstart = 0
but not able to download all the files (application, package HTMLDB_TOOLS and PAGE_SENTRY function) could not find the PAGE_SENTRY function.
AND when I open this link http://apex.oracle.com/pls/apex/f?p=27746
I could not run the application. I've provided a CSV file and when I click on SEND, I get the error:
ORA-06550: line 1, column 7: PLS-00201: identifier ' HTMLDB_TOOLS. PARSE_FILE' must be declared
tried in apex.oracle.com host as shown in the previous post.
any help pls..,.
Another method to load data into the tables..., (as dataworkshop)Hello
I have check app works very well.
Have you read instructions?
Load a CSV file in a table
>
Create a small csv file ascol1, col2, col3
VARCHAR2 (10), Number, "Number (10.2)" "
Cat, 2, 3.2
dog, 99, 10.4
>
First row must have valid column names. To verify that your first line of titles have no spaces or those who are not words reserved.
Second line of the CSV file must have column of table data types.When you meet these requirements app works perfectly
Kind regards
Jari -
Need help with loading the XML file
Hello
I spent reviewing the web/forums for an example on how to do this for a few days now. I managed to get this working in Flash Pro easily enough, but I think I'm missing something when I want to do the same thing in Flex.
Basically, I want to load an XML file and then set the values of the text of labels 5, equal to the data in the XML file.
So I have a button created in MXML and have put the following click event:
Click = "dsSetup (Event)" "
I also stated the following:
public var myRequest:URLRequest = new URLRequest ("assets/myFile.xml"); folder located under the CBC in project
public var myLoader:URLLoader = new URLLoader();
public var myXML:XML;
My function that loads is as follows:
public function dsSetup(event:MouseEvent):void
{
trace ("dsSetup");
myXML = new XML (myLoader.data);
H3. Text = myXML.source.itemA;
H4.text = myXML.source.itemB;
H5.text = myXML.source.itemC;
H7.text = myXML.source.itemD;
H8.text = myXML.source.itemE;
currentState = "MainMenu";
}
myLoader.addEventListener (Event.COMPLETE, dsSetup); I think that this line is no longer as I put it in the MXML
myLoader.load (myRequest);
It's the way I did in Flash and it worked fine, but I must be missing something when it comes to Flex.
Can you explain or point me to a good tutorial that shows how to load XML in Flex code?
Those I've found seems to have about 50 lines of code just to load a file and add through a complex for a beginner.
Thank you very much
I suggest you save the data loaded in a variable that can be linked, then bind the properties of the text - who:
[Bindable]
var myXML:XML;
public void dsSetup(event:MouseEvent):void
{
myXML = new XML (myLoader.data);currentState = "MainMenu";
}...
-
Problem loading an xml file if not placed locally.
Hey!
I started a discussion on my capture setting problem and I now reduced it now. It turns out it wasn't settings do not have caught. The swf file takes the fine settings, so this apparently isn't the issue. My problem is that it seems that the file won't loaded .xml. When I have my .xml and .swf file locally on my computer and it works, it works very well. When I place it on my web server the same way, it works fine. However, when someone puts my .swf in embedded on their Web site that the XML will not be loaded by the SWF for a reason any. Here's the AS3 code, load the xml file. He was works well all the way until I started playing with the call of the swf from different sources (web server of my friend in the integrating etc.).
-loading of the external xml file.
var urlRequest:URLRequest = new URLRequest ("http://www.website.com/folder/myfile.xml");
var urlLoader:URLLoader = new URLLoader();
var myXML:XML = new XML();
var xmlList:XMLList;
myXML.ignoreWhitespace = true;
urlLoader.addEventListener (Event.COMPLETE, fileLoaded);
urlLoader.load (urlRequest);
function fileLoaded(event:Event):void {}
the code to play with the xml file once loaded
}
It seems that fileLoaded() is never executed unless the swf runs locally or on my computer or my server or called directly in the browser (like by typing in the web address field). I really can't understand what is wrong. Any suggestion is appreciated!
try to create a file crossdomain.xml with this information:
http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
-
Loading multiple Xml files.
Ive got a menu based on xml and xml Photo Gallery based on the same chassis on my calendar.
When I try to preview the film only the photogallery load xml file.
I was wondering if anyone knows a method to load two xml files at a time or one after the other...
Ive been after Jacques tutorials for menu xml and xml photo gallery... my code is very similar to them.
Thanks in advance.
Chris.Simply create separate XML objects.
myXmlMenu = new XML();
myXmlGallery = new XML();
myXmlMenu.load (...)
myXmlGallery.load (...)
etc. -
Load the XML file into Oracle external Table
I load the data from the XML file into an intermediate table Oracle using external Tables.Let's say below, it is my XML file
< header >
< A_CNT > 10 < / A_CNT >
< E_CNT > 10 < / E_CNT >
< AF_CNT > 10 < / AF_CNT >
< / header >
< student >
<>students-details
< Student_info >
< Single_Info >
< ID > 18 / < ID >
New York < City > < / City >
< country > United States < / country >
< Name_lst >
< Student_name >
Samuel < name > < / name >
Paul < Last_name > < / Last_name >
< DOB > 19871208 < / DOB >
Aware of < RecordStatus > < / RecordStatus >
< / Student_name >
< Student_name >
Samuel < name > < / name >
Paul < Last_name > < / Last_name >
< DOB > 19871208 < / DOB >< TerminationDt > 20050812 < / TerminationDt >
History of < RecordStatus > < / RecordStatus >
< / Student_name >
< / Name_lst >
< Personal_Info >
<>men < / Type >
< 27 > < / Age >
< / Personal_Info >
< / Single_Info >
< / Student_info >< student - register >
class < A >
< info >
< detail >
< ID student > 18 < / student >
EE < major > < / Major >
< course-Grades >
< course > VLSI < / course >
< degree > 3.0 < / Grade >
< / course-Grades >
< course-Grades >
< course > nanotechnology < / course >
< degree > 4.0 < / Grade >
< / course-Grades >
< / details >
< detail >
< ID student > 18 < / student >
THIS < major > < / Major >
< / details >
< / info >
class < A >
< Student_Enrol >
<>students-details
< student >I load this XML data file into a single table using an external Table. Could someone help me please with coding.
Thank you
Reva
Could you please help me how to insert my XML content into that.
Same as before, try a plain old INSERT:
insert into xml_pecos
values)
XmlType (bfilename ('XML_DIR', "test.xml"), nls_charset_id ('AL32UTF8'))
);
But you'll probably hit the same limitation as with the binary XMLType table.
In this case, you can use FTP to load the file as a resource in the XML DB repository.
If the XML schema has been registered with the hierarchy enabled then the file will be automatically inserted into the table.
Could you post the exact statement that you used to save the scheme?
In the meantime, you can also read this article, I did a few years ago, it covers the XML DB features that may be useful here, including details on how to load the file via FTP:
https://odieweblog.WordPress.com/2011/11/23/Oracle-XML-DB-a-practical-example/
And documentation of the course: http://docs.oracle.com/cd/E11882_01/appdev.112/e23094/xdb06stt.htm#ADXDB4672
-
Loading the XML file with the missing elements dynamically by ODI
Hi guys,.
I have the XML with two nodes Employee and address below. On a daily basis, sometimes the address element might not come from the source xml file, but my interface has columns mapped to the elements of the address, and that is why it may fail because of the source element is not found in the file or data could not get charged because the State 'and' in the sql query that is generated between the employee and address elements. Is there a way where I can load the data dynamically where I can search in the file only for items (used) present and dynamically loading data only for these items?
XML file:
<? XML version = "1.0" encoding = "UTF-8"? >
< EMP >
< Empsch >
< employee >
< EmployeeID 12345 > < / EmployeeID >
< original > t < / initials >
John < name > < / LastName >
DOE < FirstName > < / name >
< / employee >
< address >
< > 12345 as WorkPhone < / as WorkPhone >
< WorkAddress > test 234 < / WorkAddress >
< / address >
< / Empsch >
< / EMP >
Thank you
Fabien Tambisetty
I managed to solve it by using left outer joins, and in referring to the structure of the table of the XSD
-
Insert xml files into the table
Hi all
How to create an application, which allows me to download an xml file and insert the file into a table, looking something like what makes the apex, with 'data-> data-> Data Load XML Workshop'.
I tried to create it using this link # 9170494
but when loading the file and send it (current executing the "sp") sends the error "ORA-22285: file for FILEOPEN operation or non-existent directory.
I could slightly auxiliary
concerning
This idea is troubling for me.
The XML file DOES NOT CHANGE. This is the goal. You have a DTD/XST that defines where in the XML hierarchy, a data element is and (so) how to access it. With this information, you can hardcode things.
Therefore, you should have no reason for that functionality 'map the data column in the table column"of the data loader since all mappings will be always the same.
As a simple INSERT... The SELECT statement can (and should) be used.
(use the FUSION if you update / insert data).
I copy + paste some of my code in a procedure that I use.
You will need to replace the parameter name (p_filename) with the value of appropriate link (name of item)
declare l_XML XMLType; begin /* get file from APEX WWV_FLOW_FILES */ begin select XMLType( blob_content, 1 ) -- 1 means that the file is USACII encoded. this may need to be changed. into l_XML from wwv_flow_files where name = p_filename; -- replace this with the appropriate ITEM NAME exception when no_data_found then raise_application_error( -20001, 'not in FLOW: ''' || p_filename || '''' ); end; /* you'll need to figure this one out */ INSERT INTO T (...) SELECT .. FROM XMLTable( '/' pasing l_xml columns
PATH -- repeat for each "column" you want to extract ); delete from wwv_flow_files where name=p_filename; end; -
DB version: 11 GR 2
If you were asked to store XML files in an oracle table, what kind of column would you use? BLOB or some other associated XML type?Balaji k wrote:
You can use SQL * Loader to load large amounts of XML data in the Oracle database.Personally, (and), I would use the XML DB instead. Just copy/ftp the file XML in the XML DB and hey presto, the XML in the database as an XMLTYPE.
And it can even load into patterns and shred the XML as well.SQL * Loader is today so clumsy, I think that was pretty well that day as other technologies have improved.
XML DB FAQ Forum:
Maybe you are looking for
-
When you use FF/Win7/64HomePremium, I followed my Hacker & sent him a msg: "Tsk, tsk-Hacking'sBadKarma! ' and it made him angry then he faked and froze my StartScreen so a"RESTful"local (who is a drunk)"WIPED"Windows, then - with/without wonder - set
-
Qosmio F50-126: how to activate the integrated graphics card?
Running Windows 7 on F50 - 126.After checking my specs on the site Web of toshiba, here are the details on my graphics card: -. Manufacturer: NVIDIA;type: NVIDIA; GeForce; 9700 M GTS supporting TurboCache; technologymemory: 512 MB dedicated VRAM (up
-
Slatebook X 2 new owner here. I have a few questions- (1) I'm unable to mount the sd card to the keyboard or the Tablet (2) it seems quite a few apps in the game that are not compatible with 'my version' store to Android. I have the last update that
-
My computer is about to crash with Vista and its features! I can't put an administrator password, because I do not have an administrator. When I try to add the Admin, I can't because I'm not an administrator! Now since under the new additions to
-
BlackBerry Smartphones SMS disappeared! Help please!
This is my first Blackberry, so please excuse any ignorance or stupidness! I got my BB around a month ago and I noticed that my texting more than three weeks have now disappeared. The names of the people I sent a text message / texting me are still t