SELECT
Report.reportID,
Report.dateCreated,
Report.name,
Report.title,
Report.reportType,
Report.urlPath
INTO
:reportID,
:dateCreated,
:name,
:title,
:reportType,
:urlPath
FROM
Report,
UserLink,
Users
WHERE UserLink.userID = :userID
AND UserLink.userName = Users.userName
AND Report.reportID NOT IN
(
SELECT
ReportUserLink.reportID
FROM
ReportUserLink
WHERE ReportUserLink.userID = :userID
)
AND Report.reportID IN
(
SELECT
ReportSecurityRoleLink.reportID
FROM
ReportSecurityRoleLink
WHERE ReportSecurityRoleLink.roleName = Users.roleName
)
ORDER BY name
|