%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'
' RequestTop10Changes.asp
'
'=====================================================
%>
<%
Option explicit
' Good idea to set when using redirect
Response.Expires = 0 ' always load the page, dont store
%>
<%
'------------ Variable Definition -------------
Dim rsTemp
Dim parInterval
Dim BaseId
'------------ Constants Declaration -----------
'------------ Variable Init -------------------
parInterval = RequestDefault("Interval", 7)
'----------------------------------------------
%>
<%
'------------------------------------------------------------------------------------------------------------------------
' Thus function formulates a query that is intended to find the top 10 packages that have changed the most in a period of
' time, limited in scope to those packages that have at least one version in the specified release.
' The function relies upon the user of this ASP file having setup the Interval parameter as needed (see RequestReleasePackages.asp)
Function formQueryString
Dim qs
' For each package ID in a release
' For each package version across all projects and releases (have to do this due to schema limitations)
' If the package version extension is the same as that being used currently in the release
' If the package version is locked, and is not a ripple
' Increment a count for this package ID
' Return the 10 package IDs with the highest counts
qs = " SELECT ordered_changed.pkg_id, ordered_changed.pkg_name || pv_outer.v_ext as pkg_name, pv_outer.v_ext, pv_outer.pv_id, pv_outer.pkg_version, ordered_changed.NumberOfChanges" _
& " FROM RELEASE_CONTENT rc_outer, PACKAGE_VERSIONS pv_outer, " _
& " ( " _
& " SELECT * FROM ( " _
& " SELECT changed.pkg_name, changed.pkg_id, COUNT(changed.pkg_name) as NumberOfChanges FROM ( " _
& " SELECT PACKAGES.pkg_name, PACKAGES.pkg_id " _
& " FROM PACKAGE_VERSIONS changed_package_versions, PACKAGES " _
& " WHERE changed_package_versions.pkg_id = PACKAGES.pkg_id " _
& " AND changed_package_versions.MODIFIED_STAMP >= (ORA_SYSDATE - :DAYS) " _
& " AND changed_package_versions.build_type <> 'Y' " _
& " AND changed_package_versions.dlocked = 'Y' " _
& " AND changed_package_versions.pkg_id IN ( " _
& " SELECT pkg_id FROM PACKAGE_VERSIONS WHERE pv_id IN ( " _
& " SELECT pv_id " _
& " FROM RELEASE_CONTENT " _
& " WHERE RELEASE_CONTENT.rtag_id = :rtag_id " _
& " ) " _
& " ) " _
& " AND changed_package_versions.v_ext IN ( " _
& " SELECT v_ext FROM PACKAGE_VERSIONS, RELEASE_CONTENT " _
& " WHERE PACKAGE_VERSIONS.pv_id = RELEASE_CONTENT.pv_id " _
& " AND PACKAGE_VERSIONS.pkg_id = changed_package_versions.pkg_id " _
& " AND RELEASE_CONTENT.rtag_id = :rtag_id " _
& " ) " _
& " ) changed " _
& " GROUP BY changed.pkg_name, changed.pkg_id " _
& " ORDER BY NumberOfChanges DESC " _
& " ) WHERE ROWNUM < 21 " _
& " ) ordered_changed " _
& " WHERE " _
& " ordered_changed.pkg_id = pv_outer.pkg_id " _
& " AND rc_outer.rtag_id = :rtag_id " _
& " AND rc_outer.pv_id = pv_outer.pv_id " _
& " order by upper(pkg_name) "
formQueryString = qs
End Function
'------------------------------------------------------------------------------------------------------------------------
%>
<%
'------------------------ MAIN LINE ---------------------------------
'--------------------------------------------------------------------
OraDatabase.Parameters.Add "RTAG_ID", Request("rtag_id"), ORAPARM_INPUT, ORATYPE_NUMBER
OraDatabase.Parameters.Add "DAYS", parInterval, ORAPARM_INPUT, ORATYPE_NUMBER
Set rsTemp = OraDatabase.DbCreateDynaset( formQueryString, cint(0))
OraDatabase.Parameters.Remove "DAYS"
OraDatabase.Parameters.Remove "RTAG_ID"
%>
<%If rsTemp.RecordCount < 1 Then %>
| None Found |
<% Else %>
|
|
<%End If%>
<%
rsTemp.Close
Set rsTemp = nothing
%>
<%
Call Destroy_All_Objects
%>