-
2. Re: How to configure xml as a data-source in teiid?
kulbhushanc Jun 23, 2017 10:04 AM (in response to rareddy)Thanks Ramesh .
We are able to select data from xml by Using query as below:
String aaa="SELECT employee.* from (call department.getTextFiles('*.xml')) f, "+ " xmltable('/dept/employee' PASSING xmlparse(document f.file) COLUMNS "+
" empID integer PATH '@id', "+
" firstname string PATH 'name/first', "+
" lastname string PATH 'name/last',"
+ "office integer PATH 'office') AS employee";
So now i am interested in to insert data in xml .
Is it possible to insert data into xml using teiid Admin api ?. If yes then what would be the query structure?
Thanks,
Kulbhushan Chaskar.
-
3. Re: How to configure xml as a data-source in teiid?
shawkins Jun 24, 2017 5:20 PM (in response to kulbhushanc)> Is it possible to insert data into xml using teiid Admin api ?. If yes then what would be the query structure?
The file translator exposes a saveFile procedure, and you can construct XML via SQL/XML constructs such as XMLELEMENT, XMLFOREST, etc. So that is saving an entire file, not just modifying a subset of values in a document.
-
4. Re: How to configure xml as a data-source in teiid?
kulbhushanc Dec 14, 2017 8:04 AM (in response to shawkins)Thanks Steven,
When you said "The file translator exposes a saveFile procedure, and you can construct XML via SQL/XML constructs such as XMLELEMENT, XMLFOREST, etc...........", could you please point me out how to implement/code for this?
Thanks,
Kulbhushan Chaskar
-
5. Re: How to configure xml as a data-source in teiid?
rareddy Dec 14, 2017 10:00 AM (in response to kulbhushanc)exec department.saveFile('path/to/myfile.xml', SQLXML);
But note that above will replace the whole XML file if existing or write the new one. Teiid cannot do appends to existing files.