Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

VB 2008 Updating Oracle db using array is it possible?

905607Dec 15 2011
I'm trying to update several records in a Oracle db, I know I can cycle through each ID and update, but is is possible to feed an array to Oracle and have it update the records that way? I have tried to search google etc., but haven't been able to find anything so far...

If anyone could let me know if it is possible or not, I would appreciate it... oh and point me in the direction I need to be going too.

Not sure how much of a need it is, but here is the code involved (not complete) :

BookIDs would be a string of ids separated by comma... this can be adjusted to another delimiter if needed.

Code:
Function fUpdateException(ByVal BookIDs As String, ByVal SO As String)

Dim strRS As String = "UPDATE TBLLPLOG SET TRACKING=:TRACKING,RECDBY=:RECDBY,RECD=1,RECDDATE=sysdate " _
& "WHERE ID="

Using Command As New OracleCommand(strRS, cnn)
Command.Parameters.AddWithValue(":TRACKING", SO)
Command.Parameters.AddWithValue(":RECDBY", pUserID)
cnn.Open()

Try
Command.ExecuteNonQuery()
Catch ex As Exception
MessageBox.Show("Unable to SAVE Exception Data: " & vbCrLf & ex.ToString)
cnn.Close()
Return False
End Try
cnn.Close()
Return True
End Using
End Function
Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 12 2012
Added on Dec 15 2011
0 comments
113 views