cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

How do you get data from SQL Query Results?

Hi Guys,

 

I need your help. When you have a query that runs against a SQL Table and returns data into 3 columns, how do you put these results a collection that you can use. Is there a way to do this?

For Example: My sql table returns the following results

Trading IDPortfolio
8868BMBTH
9898CBGFk
9899GTGFU

 

I think my effort has been able to get the first column value but not the 2nd or 3rd column.

What am I missing?

 

Regards

 

Bhuti

Labels: (1)
0 Kudos
Reply
6 Replies
Workflow Hero

Re: How do you get data from SQL Query Results?

In the Execute SQL action, right under the Query section, you'll see a "Column to retrieve" box.  There you just specify the name of the column you want to retrieve and click "Add" button.  This now appears with a drop down next to it beneath the add area, and you can select a collection to which you want to store the values.

Hope this helps,

Mike

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: How do you get data from SQL Query Results?

Hi Mike,


Yes I see that option but how do I get all the results in the query? When I tried that I got the first results but how do I get 2nd record and 3rd etc?


I guess my confusion is if my SQL is returning many records how do I get the values from that 1 SQL Execution.


Currently I have done many of these where I run the first query to get the value that will give me unique record and I loop through the first query and passing the unique value to get the rest of the fields. In the current situation I don't have a unique field. I hope my explanation is clear.


Regards


Bhuti

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: How do you get data from SQL Query Results?

I reread the original post and following what I said previously: You will be using the "Get" operation within a Collection Operation action - you will have one of these actions for every column of data.   You will use the same "index" which is a number type variable within your loop to get the data from each collection to form a row of data.

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: How do you get data from SQL Query Results?

Did this answer your question?

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: How do you get data from SQL Query Results?

Hi Mike,

Haven't tried it yet, Sunday familt time. Will let you know once I have.

Regards 

Bhuti
0 Kudos
Accept as Solution Reply
Workflow Hero

Re: How do you get data from SQL Query Results?

Bhuti Mbele, Did you get this working? I also get 1 result only after using separate collection operation. What else is needed?

WF

0 Kudos
Accept as Solution Reply