HP QC SQL Queries

Test-lab:
SELECT CY_CYCLE AS "Test Set",
       TS_NAME AS "Test Script Name",
       TC_ACTUAL_TESTER AS "Tester",
       TC_STATUS AS "Execution Status",
       LEFT(CONVERT(VARCHAR,TC_EXEC_DATE,20),10)  AS "Execution Date"
FROM TEST, TESTCYCL, CYCLE
WHERE CY_CYCLE_ID = TC_CYCLE_ID
AND   TS_TEST_ID = TC_TEST_ID
AND CY_CYCLE_ID IN (cycleid)

Test-Summary:
SELECT CY_CYCLE,
       TC_STATUS,
       COUNT(TS_NAME)
FROM TEST, TESTCYCL, CYCLE
WHERE CY_CYCLE_ID = TC_CYCLE_ID
AND   TS_TEST_ID = TC_TEST_ID
AND CY_CYCLE_ID IN (cycleid)
GROUP BY CY_CYCLE, TC_STATUS
ORDER BY CY_CYCLE, TC_STATUS

Run-rate:
SELECT CY_CYCLE,
       TC_ACTUAL_TESTER,
       TC_STATUS,
       LEFT(CONVERT(VARCHAR,TC_EXEC_DATE,20),10),
       COUNT(TS_NAME)
FROM TEST, TESTCYCL, CYCLE
WHERE CY_CYCLE_ID = TC_CYCLE_ID
AND   TS_TEST_ID = TC_TEST_ID
AND CY_CYCLE_ID IN (cycleid)
GROUP BY CY_CYCLE, TC_ACTUAL_TESTER, TC_STATUS, TC_EXEC_DATE
ORDER BY CY_CYCLE, TC_ACTUAL_TESTER, TC_STATUS, TC_EXEC_DATE
Bottom-Line:
SELECT TC_STATUS,
       COUNT(TS_NAME)
FROM TEST, TESTCYCL, CYCLE
WHERE CY_CYCLE_ID = TC_CYCLE_ID
AND   TS_TEST_ID = TC_TEST_ID
AND CY_CYCLE_ID IN (cycleid)
GROUP BY TC_STATUS
ORDER BY TC_STATUS
Defects:
SELECT BUG.BG_BUG_ID AS "Defect ID",
BUG.BG_USER_03 as "Application",
BUG.BG_SUMMARY AS "Summary",
BUG.BG_DETECTED_BY AS "Detected by",
LEFT(CONVERT(VARCHAR,BUG.BG_DETECTION_DATE,20),10) AS "Detected on",
BUG.BG_RESPONSIBLE AS "Assigned To",
BUG.BG_SEVERITY AS "Severity",
BUG.BG_PRIORITY AS "Priority",
BUG.BG_STATUS AS "Status",
BUG.BG_USER_01 AS "Test Environment",
BUG.BG_USER_02 AS "Test Phase",
BUG.BG_USER_09 AS "Root Cause"
FROM BUG
WHERE BUG.BG_DETECTED_IN_RCYC = 0028
/*AND BUG.BG_USER_01 = 'SIT'*/
AND BUG.BG_USER_02 = 'SIT'
ORDER BY BUG.BG_BUG_ID

Comments

Popular posts from this blog

Terminal Emulation – QTP Automation Testing

Testing Topics