cancel
Showing results for 
Search instead for 
Did you mean: 

Error when Appending a Single Row Collection to a Multi-Row Collection having the same columns

PeterLomi
Level 3
When attempting to append a single row collection to a multi-row collection, I'm getting an internal error stating that the number of columns is not the same in both collections.  The columns are exactly the same in both, so not sure why BP thinks they're different.  In fact, one collection was created by copying the other and there were no modifications since.  I am unable to get past this issue.  Let me explain what I'm trying to do: I am looping through rows on a mainframe screen.  For each row, I read the data fields I need and store them in a single-row collection.  I then append this single-row collection to a "combined" collection that is of the exact same format as the single-row collection and simply accumulates the data read from each row of the mainframe screen.  These actions repeat in a loop until all rows on the screen have been processed.  There is no reason that BP should think the collections don't have the same number of fields.  Can anyone help with this, or offer a better suggestion as to how to accomplish this task? Thank you.
2 REPLIES 2

RanjeetPatel1
Level 3
Hi Peter   Try to use getfields from both the  collection and then check if the number of columns and columns names are same. Then you can merge the collection or use add rows to collection using collection manipulation object Hope this helps.   Regards Ranjeet   

PeterLomi
Level 3
Ranjeet, Thanks for your help.  I tried your suggestion and found that the columns were indeed different.  Despite the single-row collection having 20 fields defined, Get Collection Fields revealed that it actually only contained the 3 fields that are read from the mainframe screen.  Thus, when subsequently trying to append to the Combined collection (having 20 fields) I got the error.