cancel
Showing results for 
Search instead for 
Did you mean: 

OnBase Query Request: Does anyone have a query that shows the document types that have not been used? If so please share:

Melika_Anderson
Champ in-the-making
Champ in-the-making

Query Request: Anyone has a query that shows the document types that have not been used? If so please share:

Still learning the DB and what data is where.

1 ACCEPTED ANSWER

Marcus_Santodon
Confirmed Champ
Confirmed Champ

This will do the trick:

SELECT DT.itemtypenum, DT.itemtypename

FROM hsi.doctype DT

WHERE DT.itemtypenum not in ( SELECT DISTINCT hsi.itemdata.itemtypenum from hsi.itemdata)

View answer in original post

7 REPLIES 7

Roger_Linhart
Elite Collaborator
Elite Collaborator
Hi Melika.

Do you mean Doc Types that contain zero documents?

Marcus_Santodon
Confirmed Champ
Confirmed Champ

This will do the trick:

SELECT DT.itemtypenum, DT.itemtypename

FROM hsi.doctype DT

WHERE DT.itemtypenum not in ( SELECT DISTINCT hsi.itemdata.itemtypenum from hsi.itemdata)

Ansley_Ingram
Elite Collaborator
Elite Collaborator

I would not recommend running either of the above queries in a production environment as it will likely cause a performance issue due to the size of the table and the lack of indexes to support the first query. 

Just to be clear, I believe you are referring to Gabe's post and not mine. My query runs in under one second in our production environment,
Getting started

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.