Rational ClearQuest : sql query get Watchers accociated with a particular CQ issue

StackOverflow https://stackoverflow.com/questions/7178329

  •  11-01-2021
  •  | 
  •  

Question

I am trying to query this database cq_production_user that is part of IBM Rational ClearQuest.

I have been launching these queries from sql server express 2008 client.

How do I get all of the Watchers associated with a particular ClearQuest issue?

Was it helpful?

Solution

Well this is what it turned out to be.

@dbidCQIssue varchar(50)
AS

--DECLARE @dbidCQIssue varchar(50)
--SET @dbidCQIssue = 'CQ00105687'

BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

-- Insert statements for procedure here
SELECT fullname as 'fullname'

FROM cqadmin.users

WHERE dbid in(SELECT    
link_builds.child_dbid
FROM cqadmin.issue iss

LEFT JOIN [cq_production_user].[cqadmin].[parent_child_links] AS link_builds 
    ON link_builds.[parent_dbid] =  iss.dbid
LEFT JOIN [cq_production_user].[cqadmin].[build] ON [cq_production_user].[cqadmin].[build].[dbid] = link_builds.[child_dbid] 
LEFT JOIN [cq_production_user].[cqadmin].[project] ON [cq_production_user].[cqadmin].[project].[dbid] = [cq_production_user].[cqadmin].[build].[project]
LEFT JOIN [cq_production_user].[cqadmin].[branch] ON [cq_production_user].[cqadmin].[branch].[dbid] = [cq_production_user].[cqadmin].[build].[branch]
LEFT JOIN [cq_production_user].[cqadmin].[users] ON [cq_production_user].[cqadmin].[users].[dbid] = iss.dbid

WHERE iss.id = @dbidCQIssue   
)

END

Rational Clearquest where everything is a left outer join

OTHER TIPS

As ClearQuest has customised records, the "Watchers" & "Issues" look like they might be records someone designed. Difficult to give direct answer...however if you have SQL creater rights as user on the client..

  1. design your query using GUI
  2. Copy/ view sql it generates...
  3. use that as a basis to get your query running externally.

Note the reference ids used in dql will be unique numbers allocated to YOUR schema records, look at your reference tables to get string names etc

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top