Click here to Skip to main content
12,943,913 members (58,878 online)
Rate this:
Please Sign up or sign in to vote.
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
Posted 15-Nov-12 23:56pm
Updated 16-Nov-12 2:55am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.

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

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 4,643
CHill60 2,970
Maciej Los 2,348
Jochen Arndt 1,900
ppolymorphe 1,765

Advertise | Privacy | Mobile
Web02 | 2.8.170518.1 | Last Updated 16 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100