I would like my Oracle to fetch an xml file directly from the Internet and insert it to a table (parsing can be omitted in this thread).
Example: https://cve.mitre.org/data/downloads/allitems-cvrf-year-1999.xml
<Vulnerability
xmlns="http://www.icasi.org/CVRF/schema/vuln/1.1" Ordinal="1">
<Title>CVE-1999-0001</Title>
<Notes>
<Note Type="Description" Ordinal="1">ip_input.c in BSD-derived TCP/IP implementations allows remote attackers to cause a denial of service (crash or hang) via crafted packets.</Note>
<Note Type="Other" Title="Published" Ordinal="2">2000-02-04</Note>
<Note Type="Other" Title="Modified" Ordinal="3">2005-12-16</Note>
</Notes>
<CVE>CVE-1999-0001</CVE>
<References>
<Reference>
<URL/>
<Description>BUGTRAQ:19981223 Re: CERT Advisory CA-98.13 - TCP/IP Denial of Service</Description>
</Reference>
<Reference>
<URL/>
<Description>CERT:CA-98-13-tcp-denial-of-service</Description>
</Reference>
<Reference>
<URL>http://www.openbsd.org/errata23.html#tcpfix</URL>
<Description>CONFIRM:http://www.openbsd.org/errata23.html#tcpfix</Description>
</Reference>
<Reference>
<URL>http://www.osvdb.org/5707</URL>
<Description>OSVDB:5707</Description>
</Reference>
</References>
</Vulnerability> *REPEAT*
First I create a table:
CREATE TABLE XML_TABLE
( ID NUMBER,
XML_DATA XMLTYPE
);
and then I would like to (if possible) INSERT a new row in the table for each new Vulnerability (everything in between the vulnerability tag in the xml).
To fetch the data I can use the following command (not sure if it's optimal for the purpose):
host curl https://cve.mitre.org/data/downloads/allitems-cvrf-year-1999.xml
The issue is to store it.