cancel
Showing results for 
Search instead for 
Did you mean: 

Query to get current usage of Core Query API (Retrievals Per Hour)

Harshal_Shravgi
Star Contributor
Star Contributor

We are on OnBase 17 SP1.

I want to write a query to check the current consumption of Core Query API (Query Meter). I have written below query but it is always giving me just one result i.e. my App Server.

 

SELECT
RU.REGISTERNAME,
PS.PRODUCTNAME,
SYSDATE AS LOG_DATE
FROM HSI.LOGGEDUSER LU
JOIN HSI.PRODUCTSOLD PS ON LU.PRODUCTTYPE = PS.PRODUCTTYPE
JOIN HSI.REGISTEREDUSERS RU ON RU.REGISTERNUM = LU.REGISTERNUM
WHERE PS.PRODUCTTYPE IN (110) AND LU.CHECKIN > 0;

 

Please help to write a correct query.

1 ACCEPTED ANSWER

Patricia_Bent
Star Contributor
Star Contributor

My usage always shows zero. Does yours show anything else?

use onbase
declare @StartDate varchar(500)
declare @EndDate varchar(500)
set @StartDate = '08/01/2013'
set @EndDate = '12/31/2013'
SELECT ps.productname AS 'LicenseName', LCU.producttype AS 'License Id', LCU.usagecount AS 'License Count', LCU.logdate AS 'Date/Time'
FROM hsi.licusage LCU
JOIN hsi.productsold ps
ON LCU.producttype = ps.producttype
where
LCU.producttype in ('110')
and LCU.LOGDATE between @StartDate and @EndDate
GROUP BY LCU.producttype,ps.productname,LCU.usagecount,LCU.logdate;

View answer in original post

2 REPLIES 2

Patricia_Bent
Star Contributor
Star Contributor

My usage always shows zero. Does yours show anything else?

use onbase
declare @StartDate varchar(500)
declare @EndDate varchar(500)
set @StartDate = '08/01/2013'
set @EndDate = '12/31/2013'
SELECT ps.productname AS 'LicenseName', LCU.producttype AS 'License Id', LCU.usagecount AS 'License Count', LCU.logdate AS 'Date/Time'
FROM hsi.licusage LCU
JOIN hsi.productsold ps
ON LCU.producttype = ps.producttype
where
LCU.producttype in ('110')
and LCU.LOGDATE between @StartDate and @EndDate
GROUP BY LCU.producttype,ps.productname,LCU.usagecount,LCU.logdate;

Thanks,

Below query is working for me:

 

Select usagecount from hsi.licusage lu

where lu.producttype=110

and lu.usagecount >0

and rownum = 1

order by lu.logdate desc;

 

This gives me current license usage for Query metering.

Note: This query is for Oracle database.