Database Reference
In-Depth Information
CREATE TABLE XMLDOCUMENT OF XMLTYPE;
We could also create a table containing an XMLType datatype column.
CREATE TABLE XML (ID NUMBER NOT NULL, XML XMLTYPE
, CONSTRAINT XPK_XML PRIMARY KEY (ID));
We can also use XMLType datatypes in PL/SQL (see Chapter 24).
DECLARE
XML XMLTYPE;
BEGIN
NULL;
END;
/
That is all we need to know about the XMLType datatype with respect
to Oracle SQL. The XMLType datatype is merely a storage medium and
has little to do with actually “doing things” to XML structures, with Oracle
SQL commands. We want to know the “what” and not the “how.” In other
words, what can we do with XML documents in Oracle SQL, not how are
they stored. The “how” part is another topic all by itself.
17.2.1.2
Generating XML from Tables
The following are various methods of generating XML code from tables in
an Oracle database:
SQL/XML Standard
. Various SQL/XML functions and attributes
adhere to the SQL Standard for XML standardized by INCITS
4
(International Committee for Information Technology Standards).
Basic functions create elements (tags), assign attributes to elements
(attributes within individual tags), and various other functions.
DBMS_XMLGEN
. This package is complex and creates an XML
document based on an entire query.
SYS_XMLGEN
. This function creates an XML document for each
row read.
XSU
. The Java XML SQL utility.
Search WWH ::




Custom Search