Skip to main content
Question

Choose from which SQLCreator to pass the data using parameters


parashari
Forum|alt.badge.img+2

Hi,

I have to area on area overlap the source polygons (shapefiles) with the data I am retrieving from 5 different SQL database connections. The shapefiles can be from the whole world and so be the database connections depending on which one to connect to. But, I would only want to read the data from the table where the source polygon exists and not the whole world.

Let's say, I have the shapefile of France and Mexico and Canada, I would only read the databases(one or multiple) from these countries and not waste time in reading the whole world and then AoAO. Also, I am using workspace parameter, so no enable/disable the connections.

I tried using the choice(multiple) parameters but couldn't work through.

Any ideas about it. Attaching connections.

Thanks.

 

3 replies

erik_jan
Contributor
Forum|alt.badge.img+17
  • Contributor
  • May 14, 2019

Instead of using SQLCreator transformers, I would use the FeatureReader to collect the data.

That allows you to pre-process the Shape file and based on the area, use a different FeatureReader.

The FeatureReader can connect to the database and process a SQL statement (if necessary) or read a table.

Hope this helps.


ebygomm
Influencer
Forum|alt.badge.img+31
  • Influencer
  • May 14, 2019

If you want to use sql to select your areas of interest, i'd swap the sqlcreators for sqlexecutors. You can then use a creator to retrieve the parameters and route your trigger feature to the correct sqlexecutor(s)


parashari
Forum|alt.badge.img+2
  • Author
  • May 16, 2019

Thank you for your response @egomm and @erik_jan.

For now, I had tried a new approach. I compare 2 automatically created excelsheets, and put it in SQLExecuter and provide a user parameter to the command.  

select * from lam_mea_oce_sea.mnr_admin_area where country_code_char3 in (@Value(country))

That's how it narrows the filtration. Something of this sort.

0684Q00000ArLUDQA3.png

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings