to check value exist in a node or not

  • hj

  • Instead of pulling back all nodes and then checking whether the local name matches, you should just pull back the nodes that do match.

    @x.exist('//ConsumerID') = 1

    From there, it's simple to see if that node has a specific value.

    @x.exist('//ConsumerID[.=11]') = 1

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • thanks Drew for replying..i got some idea this is exactly i want

    IF (@x.exist('//ConsumerID[./text()]') = 1) AND (@x.exist('//RoleConsumerID[./text()]') = 1)

    SELECT 'Exists' AS Result

    ELSE

    SELECT 'Does not exist' AS Result

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply