Skip to content

XQuery string-concat Function

How to use the XQuery concat function to combine multiple strings into a single result with proper syntax and parameter handling.

XQuery string-concat Function

The concat function is used to concatenate various strings.

Syntax

concat($input as xs:anyAtomicType?) as xs:string

Input Parameters

  • $input is one or more inputs separated by comma.

Example

XQuery Expressionxquery
let $bookTitle := "Learn XQuery"
let $updatedTitle := concat($bookTitle,",price: 50$")

return
   <result>
      <title>{$updatedTitle}</title>
   </result>
Outputxml
<result>
   <title>Learn XQuery,price: 50$</title>
</result>
Navigation