Output of a table which is based on XML Schema



I'm having a problem with data output using SQLDeveloper. This is my first time using xml and creating xml schemas, so i'm sure someone can help me with what i'm doing wrong. So I created this xml schema file which basically stores info about artists and their corresponding albums. I'll upload the full code to google drive because it's quite long.


albumrecordsshema.xsd : http://ift.tt/1uplq5k


After i created that, i registered it in database using this code:



BEGIN
DBMS_XMLSCHEMA.REGISTERSCHEMA(
SCHEMAURL => 'http://localhost:8080/public/albumrecordsshema.xsd',
SCHEMADOC => bfilename ('XMLDIR', 'albumrecordsshema.xsd'),
CSID => nls_charset_id ('AL32UTF8')
);
END;


Then i made a table from that schema



CREATE TABLE albumrecords OF XMLTYPE
XMLSCHEMA "http://localhost:8080/public/albumrecordsshema.xsd"
ELEMENT "albumrecords";


Everything worked, table was created and so was the schema. Then i inserted some values from xml file. And again, xml file is too long, so here's the link to it:


albumrecords.xml http://ift.tt/16b2DXe


But now when i try to see the data, it doesn't go further than few lines. Here's the select statement i'm using:



select a.getclobval() from albumrecords a;


Output:



<?xml version="1.0" encoding="WINDOWS-1257"?>
<albumrecords>
<album_artist art


Am i doing something wrong? Any help with my problem would be greatly appreciated.


No comments:

Post a Comment