I am trying to select XML from DB Oracle12g. XML is stored in the table (XMLType store as binary XML) and I am not able to create Select query with where-condition. My problem is that query doesn't return any record. I am using Oracle SQL Developer 4.1.0.19.
Examples of my queries
SELECT OBJECT_VALUE
FROM A_STUDENT_BIN
WHERE existsNode(object_value,'//Student[@RodneCislo="123"]') = 1;
SELECT OBJECT_VALUE
FROM A_STUDENT_BIN
WHERE extract(OBJECT_VALUE, '//Student[@RodneCislo="123"]') IS NOT NULL;
Table Structure:
CREATE TABLE a_student_bin OF XMLTYPE XMLTYPE STORE AS BINARY XML;
Inserted XML
<?xml version="1.0" encoding="windows-1250" ?>
<Vystup>
<Student RodneCislo="123">
<Jmeno>Pepa</Jmeno>
<Prijmeni>Omacka</Prijmeni>
<TitulPred>Ing.</TitulPred>
<TitulZa></TitulZa>
</Student>
</Vystup>
XML was inserted into db by query:
insert into A_STUDENT_BIN
values (XmlType( bfilename('MYDIR','student.xml'),
nls_charset_id('EE8MSWIN1250') );