I am receiving an error when attempting to run my SQL query within HP Quality Center. The message is "Quality Center cannot run the query because it contains invalid statements. The database is Oracle. My query is:
WITH AUDIT AS
(
SELECT AUDIT_LOG.AU_ENTITY_ID AS DEFECT_ID,
MIN(AUDIT_LOG.AU_TIME) AS Date_Deferred,
AUDIT_LOG.AU_USER AS UserName_Deferred
FROM AUDIT_LOG
INNER JOIN AUDIT_PROPERTIES
ON AUDIT_LOG.AU_ACTION_ID = AUDIT_PROPERTIES.AP_ACTION_ID
WHERE AUDIT_LOG.AU_ENTITY_TYPE = 'BUG'
AND AUDIT_LOG.AU_ACTION = 'UPDATE'
AND AUDIT_PROPERTIES.AP_TABLE_NAME = 'BUG'
AND AUDIT_PROPERTIES.AP_FIELD_NAME = 'BG_STATUS'
AND AUDIT_PROPERTIES.AP_NEW_VALUE = 'Deferred'
GROUP BY
AUDIT_LOG.AU_ENTITY_ID,AUDIT_LOG.AU_USER
),
WITH BUG_LIST AS
(
SELECT BUG.BG_BUG_ID/*Defect.Defect ID*/, BUG.BG_DETECTION_DATE /*Defect.Detected on Date*/, BUG.BG_USER_01 /*Defect.Application*/, BUG.BG_SEVERITY /*Defect.Severity*/, BUG.BG_STATUS /*Defect.Status*/, BUG.BG_USER_11 /*Defect.Planned Closing Date*/, BUG.BG_DETECTED_BY /*Defect.Detected By*/
FROM BUG /*Defect*/
WHERE BUG.BG_USER_17 /*Defect.Finding Group*/ = 'UAT'
ORDER BY BUG.BG_DETECTION_DATE ASC
)
SELECT *
FROM BUG_LIST
INNER JOIN AUDIT ON AUDIT.DEFECT_ID = BUG_LIST.BG_BUG_ID
The "AUDIT" query is looking for any bug in QC that has, at some point, had its status changed to "Deferred". This contains bugs from all teams using HPQC. The "BUG_LIST" query is looking specifically for bugs that were found by the "UAT" group. I can run each query separately and am attempting to combine the two so that I get a list of bugs found by "UAT". If a bug found by UAT has a deferred date status change associated with it, display this info and if not, leave this info blank for the specific defect.
The reason I am attempting this is because any bugs going into a "Deferred" Status do not have a "planned closing date" like closed bugs do. Because of this, rather than the close date, I would like to see the date the bug moved into deferral status and consider that my "close date".
Does HPQC not support "WITH" statements? Is there some way I can successfully combine and run these queries?