cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

SQL Select * into Collection Variable

Couldn't sworn I remember a couple of detailed posts or help docs that laid out how to Execute SQL and have the results all dumped into a Collection Variable, so that you can reference each a la an array, but I'm not finding it when I search so posting and hoping someone might point me either in the right direction or to a good resource.

I can set up the Execute SQL action, and it returns data when I Run Now.  I can see all the fields, and rows.  I can download it to CSV.

However, I can't seem to get the data into a varaible.  The documentation says it will only return the first value if you don't use a collection var, but I am using one and still it seems to only give me the first piece.

I'm sure I'm missing something super-obvious, but I'm just not seeing it.  I do see the ability to specify a column, but seems like that would mean that I have to manually set up different collection variables for each column(?) and then access the corresponding row data individually?

Thanks in advance for any pointers,

Ben

Labels: (1)
0 Kudos
Reply
3 Replies
fhunth
Nintex Newbie

Re: SQL Select * into Collection Variable

0 Kudos
Reply
burkslm
Nintex Newbie

Re: SQL Select * into Collection Variable

Do a count on the collection variable and display it using a Log History action. This is just to make sure. Were you looping through your collection?

0 Kudos
Reply
Not applicable

Re: SQL Select * into Collection Variable

Thanks for the replies, guysSmiley Happy.

Did see that one, Fernando, but was more focused at first on getting the sql's output into an array, and I think I need to resign to there not really being something like a multidimensional array. 

Seems like you have to manually 'create' it by creating a collection variable for each field and use an action set or collection action to effect something that associates them. And, seems like you need to know in advance what the column names are (or else maybe jump through all kinds of hoops to parse and split on a raw dump?).  Oh well; could still be missing something obvious, but guessing not.

Ben

ps for future searchers, I did eventually find the doc I was remembering, but alas it did just confirm that what I wasn hoping for doesn't seem to be the way of things. Just dropping the link here because it's well presented and has handy sample NWF files:

http://www.vadimtabakman.com/nintex-workflow-iterate-through-related-collections.aspx

Reply