Skip to content

Instantly share code, notes, and snippets.

@jmelloy
Created February 27, 2013 00:51
Show Gist options
  • Save jmelloy/5043872 to your computer and use it in GitHub Desktop.
Save jmelloy/5043872 to your computer and use it in GitHub Desktop.
SELECT lines.lineitem, lines.description, lines.partid,
lines.unitprice, lines.quantity
FROM purchaseorder,
XMLTable('for $i in /PurchaseOrder/LineItems/LineItem
where $i/@ItemNumber >= 8
and $i/Part/@UnitPrice > 50
and $i/Part/@Quantity > 2
return $i'
PASSING OBJECT_VALUE
COLUMNS lineitem NUMBER PATH '@ItemNumber',
description VARCHAR2(30) PATH 'Description',
partid NUMBER PATH 'Part/@Id',
unitprice NUMBER PATH 'Part/@UnitPrice',
quantity NUMBER PATH 'Part/@Quantity')
lines;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment