Rational ClearQuest : sql query get Watchers accociated with a particular CQ issue
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 200开发者_如何学运维8 client.
How do I get all of the Watchers associated with a particular ClearQuest issue?
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
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..
- design your query using GUI
- Copy/ view sql it generates...
- 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
精彩评论