betoesquivel

xquery2

Oct 8th, 2014
530
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.33 KB | None | 0 0
  1. SELECT idCategoria, NombreCategoria, XMLQuery(
  2. 'for $x in collection("CatalogoCD")/catalogo/cd
  3. let $artista := $x/artistas/artista[1]
  4. return
  5.  <cd>
  6.    <id>{$x/@id}</id>
  7.    <artista> {$artista}</artista>
  8.    <origen> {data($artista/@origen)}</origen>
  9.  </cd>'
  10. PASSING CatalogoCD RETURNING CONTENT
  11. ) AS AutorCDS
  12. FROM Categorias
Advertisement
Add Comment
Please, Sign In to add comment