XQuery idiom return() -


why see return() @ end of xquery query?

e.g.

 let $updateissues:=      $issue in fn:collection("inprogress_audit")/productissue      return local:updateissue($issue)    return () 

it's not entirely clear question is. given way you've formulated it, possible answers include:

  • you see because it's there.
  • you see because typed when wrote query.

perhaps mean 'why there?' possible answers include:

  • it's there because without return clause flwor expression begun let clause not complete.
  • it's there because author of query has quirky sense of humor, , thought four-line query amusing way write expression denoting empty sequence (which can more concisely written ()).
  • it's there because author of query wants reader know he'd rather writing c or java or, really, other programming language.
  • it's there because author of query finds amusing return keyword in xquery can written function call. (the author may enjoy hazing newbies , practical jokes, too; approach caution.)

perhaps mean "what query mean , how mean it?" possible answers include:

  • the query returns empty sequence.
  • the query takes form of flwor expression defines binding variable updateissues (whose value given nested flwor expression), , returns () (that is, empty sequence). since nothing in return clause depends on value of updateissues, there no need xquery engine evaluate expression used specify value (but there no guarantee won't -- processors allowed smart optimization not required be).

Comments