Hi Everyone,
Im using the following function to get a list of all tables in the database:
I then use a timer to wait 10 minutes which then runs another function which is essentially the same as above but the returned collection is named differently.
I then want to compare the data in both collections against each other to see if there have been any changes made to the Tables i.e. if a table has been created or deleted or it one has been renamed.
Does anyone know how i might do this?
Im using the following function to get a list of all tables in the database:
VB.NET:
Public Function getTableList(ByVal strOracleConnection As String)
'Get table list from database
Dim tblReturned As New Collection
Dim strQuery As String = String.Empty
strQuery = "SELECT * FROM TAB " & _
"WHERE TABTYPE='TABLE'"
Services.postEvent(m_strOracleConnection, "getTableList", "Querying database for list of tables.", Services.NotificationType.Notification, True, False)
Using oraConn As New OracleConnection
oraConn.ConnectionString = strOracleConnection
Using oraCmd As New OracleCommand(strQuery, oraConn)
'Try to open the connection
Try
oraCmd.Connection.Open()
Using oraRdr = oraCmd.ExecuteReader()
If oraRdr.HasRows Then
oraRdr.Read()
For intLoop As Integer = 0 To (oraRdr.FieldCount - 1)
Dim strColName = oraRdr.GetName(intLoop)
tblReturned.Add(getDBV(oraRdr, strColName), strColName)
Next
Services.postEvent(m_strOracleConnection, "getTableList", "Table list acquired successfully", Services.NotificationType.Notification, True, False)
End If
End Using
Catch oraException As OracleException
Dim excToThrow As New Exception("[0010105X] " & oraException.Number & " " & oraException.Message, oraException)
Throw (excToThrow)
Catch exError As Exception
Dim excToThrow As New Exception("[0010106] " & exError.Message)
Throw (excToThrow)
Finally
MDL.DatabaseAccess.closeConnection(oraConn)
End Try
End Using
End Using
Return tblReturned
End Function
I then use a timer to wait 10 minutes which then runs another function which is essentially the same as above but the returned collection is named differently.
I then want to compare the data in both collections against each other to see if there have been any changes made to the Tables i.e. if a table has been created or deleted or it one has been renamed.
Does anyone know how i might do this?