xquery-functions-on-sequences-empty

xquery
#xquery#functions-on-sequences-empty
Syntax

          fn:empty($arg as item()*) as xs:boolean
        

Returns True if the value of

$arg

is an empty sequence. Otherwise, the function returns False.

$arg

A sequence of items. If the sequence is empty, the function returns True. Otherwise, the

function returns False.

The

function is not supported. As an alternative, the

function can be used.

This topic provides XQuery examples against XML instances that are stored in various

type

columns in the AdventureWorks database.

In the manufacturing process for Product Model 7, this query returns all the work center

locations that do not have a

attribute.

fn:empty($arg as item()*) as xs:boolean
SELECT ProductModelID, Instructions.query('
declare namespace AWMI="https://schemas.microsoft.com/sqlserver/2004/07/adventure-
works/ProductModelManuInstructions";
for $i in /AWMI:root/AWMI:Location[empty(@MachineHours)]