> >
> > I need to loop over a structure and insert the items into another
> > database based on the type of item in the query column.
> >
> > The requirement for the looping, is that I don't know how many items
> > will ever be in this structure at one time.
> >
> > I have tried to write the loop, but i keep getting errors with the
> > syntax that the loop produces.
Assuming that your structure keys match up with the database fields,
you should be able to loop through the list of keys to build the field
list and then loop through the keys grabbing the value for the value
list.
One thing that you might not be taking into consideration is the type
of variable that you're passing in. Anything that contains alpha
characters is going to require single quotes... do you have a method
in place to determine the type of field based on the field name?
If you do then make sure you're using those rules - otherwise you
might need to rethink how you're storing the data in the structure and
look at a 3-for-1 approach - three keys in the struct for each field,
one containing name, one containing the value and one containing the
field type.
That's just my two minute rambling at 7am - take it for what it's worth ;)
Hatton
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

