How to bypass an exception error that occurs in Oracle when invoked through ASP.net code

I have a program that reads a oracle table and parse the data into various sub tables

The problem i am facing is that when an error occurs while tranforming the data to the sub tables, i need the program to continue processing the remainder of the records . How do i do implement this.

Here is a code i use to insert to sub tables.  When an error occurs while inserting a record to this table, i need it to continue on....

 Public Sub InsertDiversity(ByVal lEngagementID As Long, ByVal sScopeDiversity As String)

        Dim oDataAccess As New DataAccess, oReader As OracleDataReader
        Dim sSQL, sSQLQuery As String
        Dim lSeqID As Long
        Try
            lSeqID = oDataAccess.ExecuteInsertReturnKeyByRef("ENGAGEMENT_DIVERSITY_ID_SEQ")
            sSQL = "INSERT INTO DIVERSITY   ( ENGAGEMENT_DIVERSITY_ID ,ENGAGEMENT_ID,DIVERSITY_LIST,CREATE_DATE ) " & _
                           "VALUES(" & lSeqID & "," & lEngagementID & ",'" & oGeneric.clearSingleQuote(sScopeDiversity) & "', sysdate )"
            '  sSQLQuery = "INSERT INTO ENGAGEMENT_DIVERSITY_SQL   ( ID,SQLQUERY) VALUES( " & lSeqID & ",'" & sSQL & "')"
            ' oDataAccess.ExecuteNonQuery(sSQLQuery)
            AddtoFile(sSQL, "Diversity.txt")
            oDataAccess.ExecuteNonQuery(sSQL)
        Finally


            oDataAccess.Close()


        End Try



    End Sub
LVL 1
GSK_DEVAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Carl TawnSystems and Integration DeveloperCommented:
You mean it throws the exception still ?

If so, just add an empty Catch block.

        Dim oDataAccess As New DataAccess, oReader As OracleDataReader
        Dim sSQL, sSQLQuery As String
        Dim lSeqID As Long
        Try
            lSeqID = oDataAccess.ExecuteInsertReturnKeyByRef("ENGAGEMENT_DIVERSITY_ID_SEQ")
            sSQL = "INSERT INTO DIVERSITY   ( ENGAGEMENT_DIVERSITY_ID ,ENGAGEMENT_ID,DIVERSITY_LIST,CREATE_DATE ) " & _
                           "VALUES(" & lSeqID & "," & lEngagementID & ",'" & oGeneric.clearSingleQuote(sScopeDiversity) & "', sysdate )"
            '  sSQLQuery = "INSERT INTO ENGAGEMENT_DIVERSITY_SQL   ( ID,SQLQUERY) VALUES( " & lSeqID & ",'" & sSQL & "')"
            ' oDataAccess.ExecuteNonQuery(sSQLQuery)
            AddtoFile(sSQL, "Diversity.txt")
            oDataAccess.ExecuteNonQuery(sSQL)
        Catch
            '// Don't do anything
        Finally

            oDataAccess.Close()

        End Try

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.