Oracle 大数据处理

        Public Function GetRowVersions(ByVal BizO As BizObject, ByVal TableName As String, ByVal URIDs As Integer()) As Long()
            Dim DSL As New DAS(BizO)
            Dim RowVersions As New Hashtable
            Dim Results As Long()
            Dim Row As DataRow
            Dim StepOn As Integer = 5000
            Dim TmpIDList As ArrayList = New ArrayList
            Try
                '''Mod by bingle 2010-6-11 这里做大数据量的分批处理
                Dim DT As DataTable
                Dim StepCount As Integer = 0
                For i As Integer = 0 To URIDs.Length - 1 Step StepOn
                    TmpIDList.Clear()
                    For j As Integer = i To i + StepOn - 1
                        If j >= URIDs.Length Then
                            Exit For
                        End If
                        TmpIDList.Add(URIDs(j))
                    Next j
                    DT = DSL.ExecuteDataTable(String.Format(SQL_ROWVERSIONS, _
                                                        TableName, DSL.VarToSql("URID", CType(TmpIDList.ToArray(GetType(Integer)), Integer()))))
                    If Not DT Is Nothing AndAlso DT.Rows.Count > 0 Then
                        For k As Integer = 0 To DT.Rows.Count - 1
                            Row = DT.Rows(k)
                            RowVersions.Add(Convert.ToInt32(Row(1)), CLng(Row(0)))
                        Next
                    Else
                        Return Nothing
                    End If
                Next i
                              Results = New Long(URIDs.Length - 1) {}
                For i As Integer = 0 To Results.Length - 1
                    If RowVersions.Contains(Convert.ToInt32(URIDs(i))) Then
                        Results(i) = CLng(RowVersions(Convert.ToInt32(URIDs(i))))
                    End If
                Next
                Return Results
            Catch Ex As Exception
                If TableName Is Nothing Then
                    TableName = String.Empty
                End If
                Biz.Trace.Exception("GetRowVersions() failed. TableName: " & TableName, ENT.ERROR Or ENT.LEVEL2, BizO, Ex)
                Return Nothing
            Finally
                'DSL.SetComplete()
            End Try

        End Function

 

你可能感兴趣的:(oracle,sql,J#)