Forum Stats

  • 3,815,604 Users
  • 2,259,059 Discussions
  • 7,893,185 Comments

Discussions

VB 2008 Updating Oracle db using array is it possible?

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.
Tagged:
This discussion has been closed.