I’m trying to retrieve information from an Oracle database using XQuery.
The table customer looks like
---id---last_name---
1 Smith
2 Jackson
3 Peters
and I want all last names.
This is my code:
select last_name, XMLQuery(
'for $i in /customer
return $i/last_name'
PASSING BY VALUE customer
RETURNING CONTENT) last_name
FROM customer;
It says, there is an %s: invalid identifier in this line: PASSING BY VALUE customer
If I understand correctly, you want to use XQuery to query purely relational data.
In that case, you can use ora:view and something such as:
should do the trick.