Link to home
Start Free TrialLog in
Avatar of CyberUnDead
CyberUnDead

asked on

Persist Array to Table

I am receiving a multidimensional array from outside my application (via web service).  I need to persist this to a table in a database.  Is there is a simple/efficient way to process this array?  The code below is too slow Example1 as it is linear function O(m*n) see Google result: http://pages.cs.wisc.edu/~vernon/cs367/notes/3.COMPLEXITY.html.   Example2 is slightly faster (not as flexible) but it still needs to iterate the maxRow times say 5000.   I am just looking to see if there is a better way to store an array to a table.
'Example 1
    For i = 0 To maxRow
        For j= 0 To maxColumn
            'save to db
        Next j
    Next i
 
    'Example 2
    For i = 0 to maxRow
      MyArray(i,0)
      '...
      MyArray(i,n)
    next i

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CyberUnDead
CyberUnDead

ASKER

LSMConsulting:

  Thanks for the reply.   If I wanted to just simply dump to a database or file how would one accomplish that?  Again my data is an multidimensional array say MyQueryBean(rows,columns).   The class below is the structure holding the data.  The class was generated by Microsoft Office 2k3 Web Services toolkit http://msdn.microsoft.com/en-us/library/aa192537(office.11).aspx.  
'struct_QueryBean.cls
Option Compare Database
Option Explicit
 
Public columnList As Variant
Public data As Variant

Open in new window

I am having the Web Service provider present the data in a different format.