Subversion Repositories DevTools

Rev

Rev 5957 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5957 Rev 6581
Line 31... Line 31...
31
'   Default data will be added at the end
31
'   Default data will be added at the end
32
Dim oJSON :Set oJSON = New aspJSON
32
Dim oJSON :Set oJSON = New aspJSON
33
Dim newitem
33
Dim newitem
34
 
34
 
35
'
35
'
36
' Determine the size of the record set
36
' Determine the MAX size of the record set, without any filtering
37
'   Gives bad results when searching
37
'   Gives bad results when searching
38
Dim MaxCount : MaxCount = 0
38
Dim MaxCount : MaxCount = 0
39
 
39
 
40
SqlQry = "select count(*) as count from SDK_TAGS st where sdk_id = '" & sdk_id &"'"
40
SqlQry = "select count(*) as count from SDK_TAGS st where sdk_id = '" & sdk_id &"'"
-
 
41
oJSON.data("CountQry") = SqlQry
41
 
42
 
42
On Error Resume Next
43
On Error Resume Next
43
objEH.ErrorRedirect = FALSE
44
objEH.ErrorRedirect = FALSE
44
objEH.TryORA ( OraSession )
45
objEH.TryORA ( OraSession )
45
Set rsQry = OraDatabase.DbCreateDynaset( SqlQry, ORADYN_DEFAULT )
46
Set rsQry = OraDatabase.DbCreateDynaset( SqlQry, ORADYN_DEFAULT )
Line 54... Line 55...
54
'   iTotalRecords = total records without any filtering/limits
55
'   iTotalRecords = total records without any filtering/limits
55
'   iTotalDisplayRecords = filtered result count
56
'   iTotalDisplayRecords = filtered result count
56
 
57
 
57
oJSON.data("draw") = CInt(Request.QueryString("draw"))
58
oJSON.data("draw") = CInt(Request.QueryString("draw"))
58
oJSON.data("recordsTotal") = MaxCount
59
oJSON.data("recordsTotal") = MaxCount
59
oJSON.data("recordsFiltered") = MaxCount
60
'oJSON.data("recordsFiltered") = MaxCount
60
 
61
 
61
Dim vName
62
Dim vName
62
for each vName in Request.QueryString
63
for each vName in Request.QueryString
63
    oJSON.data("sReq_" & vName) = Request.QueryString(vName)
64
    oJSON.data("sReq_" & vName) = Request.QueryString(vName)
64
next
65
next
Line 98... Line 99...
98
Else
99
Else
99
    sortString = " ORDER BY " & sortCols(CInt(1)) & " asc"
100
    sortString = " ORDER BY " & sortCols(CInt(1)) & " asc"
100
End If
101
End If
101
 
102
 
102
' Filter (search )
103
' Filter (search )
103
Dim searchString
104
Dim searchString : searchString = ""
104
If Request.QueryString("search[value]") <> "" Then
105
If Request.QueryString("search[value]") <> "" Then
105
    searchString = " AND upper(pkg_name) LIKE upper('%" & Request.QueryString("search[value]") & "%')" 
106
    searchString = searchString + " AND upper(SDKTAG_NAME) LIKE upper('%" & Request.QueryString("search[value]") & "%')" 
106
End If
107
End If
107
 
108
 
108
' Filter (state)
109
' Filter (state)
109
If Request.QueryString("sdkstateFilter") <> "" Then
110
If Request.QueryString("sdkstateFilter") <> "" Then
110
    searchString = " AND UPPER(SDK_STATE) in (" & Request.QueryString("sdkstateFilter") & ")" 
111
    searchString = searchString + " AND UPPER(SDK_STATE) in (" & Request.QueryString("sdkstateFilter") & ")" 
111
End If
112
End If
112
 
113
 
113
' Create a list of cols that we need. Avoids ambiguity in selections
114
' Create a list of cols that we need. Avoids ambiguity in selections
114
Dim x,colList,colListJoin
115
Dim x,colList,colListJoin
115
For x = Lbound(dataCols) to Ubound(dataCols)
116
For x = Lbound(dataCols) to Ubound(dataCols)
Line 130... Line 131...
130
SqlQry = "select * from ( "&_
131
SqlQry = "select * from ( "&_
131
            "select a.*, ROWNUM rnum from (" & BasicSql &_
132
            "select a.*, ROWNUM rnum from (" & BasicSql &_
132
                ") a where ROWNUM <= " & lastRow &_
133
                ") a where ROWNUM <= " & lastRow &_
133
            ") where rnum >= " & firstRow
134
            ") where rnum >= " & firstRow
134
 
135
 
-
 
136
'
-
 
137
'   Perform a query without pagination
-
 
138
'   Assume the record set is small enough that it won't impact speed
-
 
139
'
-
 
140
'
-
 
141
' Determine the size of the record set
-
 
142
'   Gives bad results when searching
-
 
143
Dim SqlCount: SqlCount = "select count(*) as count from (" & BasicSql & ")"
-
 
144
On Error Resume Next
-
 
145
objEH.ErrorRedirect = FALSE
-
 
146
objEH.TryORA ( OraSession )
-
 
147
Set rsQry = OraDatabase.DbCreateDynaset( SqlCount, ORADYN_DEFAULT )
-
 
148
objEH.CatchORA ( OraSession )
-
 
149
    If ((NOT rsQry.BOF) AND (NOT rsQry.EOF)) Then
-
 
150
        MaxCount = rsQry("COUNT")
-
 
151
    End If
-
 
152
rsQry.Close
-
 
153
Set rsQry = Nothing
-
 
154
 
-
 
155
' Basic Header
-
 
156
'   iTotalRecords = total records without any filtering/limits
-
 
157
'   iTotalDisplayRecords = filtered result count
-
 
158
 
-
 
159
'oJSON.data("recordsTotal") = MaxCount
-
 
160
oJSON.data("recordsFiltered") = MaxCount
-
 
161
 
-
 
162
 
135
' Assist in debug
163
' Assist in debug
136
oJSON.data("BasicSql") = BasicSql
164
oJSON.data("BasicSql") = BasicSql
137
'oJSON.data("SqlQry") = SqlQry
165
'oJSON.data("SqlQry") = SqlQry
138
 
166
 
139
' Perform the database query
167
' Perform the database query