03-25-2020 04:15 PM
Hi there,
I want to get a list of all document groups names and then a list of all document type names. I can't figure it out looking at the documentation.
I don't want any particular document, just their associated type name.
THanks!
03-26-2020 05:31 AM
Depending on the size of your Database this might take a couple minutes to run.
SELECT CASE WHEN itg.itemtypegroupname IS NULL THEN CASE WHEN dt.itemtypename IS NULL THEN '-- Grand Document Total' END ELSE itg.itemtypegroupname -- Document Type Group Total END as 'Document Type Group Name', CASE WHEN dt.itemtypename IS NULL THEN CASE WHEN itg.itemtypegroupname IS NULL THEN '-- Document Type Document Grand Total' ELSE '-- Document Type Group Total' END ELSE dt.itemtypename -- Document Type Total END as 'Document Type Name', COUNT(id.itemnum) as 'Document Type Page Count' FROM hsi.itemdata id JOIN hsi.doctype dt ON dt.itemtypenum = id.itemtypenum JOIN hsi.itemtypegroup itg ON itg.itemtypegroupnum = id.itemtypegroupnum GROUP BY itg.itemtypegroupname, dt.itemtypename with ROLLUP ORDER BY itg.itemtypegroupname ASC
03-26-2020 05:55 AM
Slimmed down SQL script if you only want the DocTypeGroups and the DocTypes:
/*
Select DocTypeGroup and DocType
*/
SELECT RTRIM(itemtypegroupname) AS DocTypeGroup, RTRIM(itemtypename) AS DocType
FROM hsi.doctype AS DT
JOIN hsi.itemtypegroup AS DTG ON DT.itemtypegroupnum = DTG.itemtypegroupnum
ORDER BY itemtypegroupname, itemtypename
03-26-2020 06:01 AM
Are you looking for a SQL query, or using the Unity API?
Dean's query includes counts of documents, but just getting lists of Document Type Group names and Document Type Names can be much simpler.
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.