SQL query to obtain a list of training batches and their statuses


Can the list of Field Extraction Training Batches and their statuses (Locked or Unlocked) be obtained using an SQL query to FlexiCapture Database?


The following query will show the list of Field Extraction Training Batches, the number of pages in said Batches, and their statuses (Locked or Unlocked).

CASE WHEN CONVERT(int, BP.Value) & 0x10000 !=0 THEN 'Locked'
ELSE 'Unlocked'
END AS LockStatus

--Change to the FlexiCapture Database Name
FROM <FlexiCapture Database Name>.dbo.Batch B

--Change to the FlexiCapture Database Name
LEFT JOIN <FlexiCapture Database Name>.dbo.BatchParameter BP
ON B.Id = BP.BatchId AND BP.Name = 'fc_predefined:TrainingState'

--Specify the ID of the project.
--ID can be checked on the Administration and Monitoring Station > Settings > Projects
WHERE B.ProjectId = <ProjectID>

AND B.BatchPurpose = 1
AND B.IsDeleted = 0
GROUP BY B.Id, B.Name, B.BatchPurpose, B.DocumentsCount, B.PagesCount, BP.Value
ORDER BY B.DocumentsCount DESC, B.Name

The query can be modified further to show only the Field Extraction Training Batches that have more than a specified number of pages or documents, etc.

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request



Please sign in to leave a comment.