Click here to Skip to main content
15,940,921 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have dataset with 1 crore data and i am looping through it and using values of dataset for updating the base table of count 2.5 crore.

The fields which is used in where clause is primary key

But still i am not getting performance only 1 lac records getting updated in 1 hr.

How do i optimize and speed up time to execute query in oracle. I am using command object, Coneection object in

Please help.

following function executed 1 crore time to update query.
public cmd_obj as new oledb.oledbcommand
Strquery="update Table1 set field1='Value from dataset' where field2='value from dataset'" ' where field2 is primary key in base table
Public Function Executenonquery(ByVal Strquery As String) As Int32
Dim intUpdated As Int32 = 0
If VerifyOracleLogin() = True Then ' check oracle connection
cmd_obj.Connection = dbconn
cmd_obj.CommandText = Strquery 'strquery has update query
intUpdated = cmd_obj.ExecuteNonQuery()
return intUpdated
End If   
Catch ex As Exception
WriteToErrorLog("Query Execution Error : " & Strquery, ex.Message)
Return -1
End Try
End Function
Updated 16-Nov-12 2:55am

1 solution

just create a stored procedure(SP) for your database.
and how to create this- google[^]
this will speed up your database easily and will take less time as comparision to earlier.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900