Skip to main content
Question

Strange issue with SQL query within workflows

  • November 12, 2024
  • 1 reply
  • 64 views

christopherlecky
Byte
Forum|alt.badge.img+17

When I run the following query in SQL it returns a single value that is an XML representation of the client list.

SELECT 
[Client].[Id] 'ClientId',
[Client].[name] 'ClientName',
[Client].[net_hostname] 'ClientHostName'
FROM
[CommServ].[dbo].[APP_Client] AS [Client]
WHERE
[Client].[status] = 2
FOR XML RAW, ROOT('ClientInfo');

The goal is to use xpath to do queries against the list rather then doing constant queries.

 

The problem is that when I run it in a workflow it looks like it paginates the results so it returns multiple rows.

 

Is there another way to do this? 

 

If you have a question or comment, please create a topic

1 reply

Forum|alt.badge.img+12
  • Vaulter
  • July 11, 2025

Hi ​@christopherlecky 

Commvault Workflows execute an XPath query Usually via XML Query activity or script, and the input XML contains a list, the workflow engine may iterate over each matching node as rows, not aggregate them as one array or list.

This can look like pagination, but it's really row-wise iteration, depending on how the For each or activity is configured. Try to Set the output as a variable of type List or XML