AnsweredAssumed Answered

Using ExecuteSQL results to create new records

Question asked by rmutsaers on Sep 3, 2012
Latest reply on Sep 3, 2012 by rmutsaers

Hi,

 

I'm creating an app where i need to get some information based on search criteria and based on the result create some records for each result.

e.g

 

ExecuteSQL("select city, count(customerID) from customers group by city" ;"";"")

 

this results in a field that has something like

 

Amsterdam, 10

Rotterdam, 15

Groningen, 5

Breda, 12

 

Now for each of these result rows i want to create a record in a summary table

so i need to loop through the result rows.

 

How can i do that in a FM Pro script.

 

In regular SQL this would be something like 'INSERT INTO summary SELECT city, COUNT(customerID) FROM customers GROUP BY city'

But how do you do this in FMPro.

 

Thanks

Rick

Outcomes