Click here to Skip to main content
12,396,054 members (64,570 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB Oracle VB.NET
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 vb.net

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
Try
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
v4

1 solution

Rate this: bad
 
good
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.
  Permalink  

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


Advertise | Privacy | Mobile
Web01 | 2.8.160721.1 | Last Updated 16 Nov 2012
Copyright © CodeProject, 1999-2016
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