I have written the following query
SELECT Specie, XMLCAST(
XMLQUERY('declare default element namespace\"http://zoo.org\";
count(/diary/entry[@kind_type="@serious"])'
) AS INTEGER
)
FROM Species;
The schema for a diary is
<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:z="http://zoo.org"
targetNamespace="http://zoo.org">
<element name="diary">
<complexType>
<sequence>
<element ref="z:entry"/>
</sequence>
</complexType>
</element>
<element name="entry">
<complexType>
<sequence>
<element name="date" type="date"/>
<element name="keyword" type="string" maxOccurs="unbounded"/>
<element name="text" type="string"/>
</sequence>
<attribute name="kind" type="z:kind_type" use="required"/>
</complexType>
</element>
<simpleType name="kind_type">
<restriction base="string">
<enumeration value="normal"/>
<enumeration value="serious"/>
</restriction>
</simpleType>
</schema>
The query gives an error:
SQL0010N The string constant which begins with "' ) ) FROM Species", contains no ending sign. SQLSTATE=42603
This was translated from danish. What is wrong with this query and is the '' placed wrong?