Thread

Skip Navigation LinksForums > SpiraTeam Forums > SpiraTeam Issues & Questi... > DB Query in Spira Spits o...

DB Query in Spira Spits out Error for Unknown Reason RSS Feed

Friday, July 11, 2014

Hello,

My company would like me to create  a sum of the test steps that have passed, failed, blocked, etc. instead of test cases.

I tried to do my own SQL query - and it works when I access the database by the SQLCMD utility, but not in the Spira query under the custom reports.

Here it is - maybe someone will know what's going on?

SELECT

SUM(CASE WHEN execution_status_id=2 then 1 else 0 end) as Pass

FROM TST_TEST_STEP      (<----From SQLCMD Utility - when I do it from the query I replace TST_TEST_STEP with SpiraEntities.R_TestSteps)

It is creating a sum correctly in the back door, but when I try and execute this in Spira I get ther error:

 execution_status_id could not be resolved in current scope or context.

Any help would be appreciated.

Thanks,

Erin

1 Replies
Erin WelchErin Welch
re: Erin Welch on Friday, July 11, 2014
Friday, July 11, 2014

Seems to work when I make the table as R.

This finally generated correctly:

SELECT

SUM(CASE WHEN R.EXECUTION_STATUS_ID=2 THEN 1 ELSE 0 END) AS PASSED,

SUM(CASE WHEN R.EXECUTION_STATUS_ID=1 THEN 1 ELSE 0 END) as FAILED,

SUM(CASE WHEN R.EXECUTION_STATUS_ID=6 THEN 1 ELSE 0 END) as CAUTION,

SUM(CASE WHEN R.EXECUTION_STATUS_ID=5 THEN 1 ELSE 0 END) as BLOCKED,

SUM(CASE WHEN R.EXECUTION_STATUS_ID=3 THEN 1 ELSE 0 END) as NOTRUN

from SpiraTestEntities.R_TestSteps as R

where R.PROJECT_ID = ${ProjectId}

Thank you!

Erin

Tagged
Statistics
  • Started: 7/11/2014
  • Last Reply: 7/11/2014
  • Replies: 1
  • Views: 409
Powered by KronoDesk v1.1.0.15 | © Copyright Inflectra Corporation 2011-2016 | Licensed to Inflectra Corporation.