Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I want to join a relationship table (same database, not in sde) to an ArcSDE feature class to distplay only needed features. This has to be done multiple times according to every row (value) of an other table (same database, not in sde too).

The first step works, but I have to make a query layer first as it looks like I cant make joins with tables not in the sde.

I do not want to create ~500 query layers (for the joins), so I'm trying to use ModelBuilder to create the query layers (and maybe also to make the joins in the future).

The figure below shows the model that Ive created so far (at the moment I dont know if this approach would generally work/do its job).

enter image description here

I want to use the value catid to perform the query in the Make Query Layer (2).

How should/could I do that?

enter image description here

Here some pseudothings

table a; -- contains some categories 
table b; -- =m:n relationship table for "a" and "c"
feature class c;
table d_*; --contains all data from "b" related to a single category (row) of "a"


foreach row in a
{
 create table d_*;
}

In psql this would be kind of simple, but I need this done on the ArcGIS level as the join of the feature class relates on this.

I was also thinking about python, because using a programming language this would also be kind of simple -- but I have no idea about python and I thought i could avoid scripting.

share|improve this question
    
You might want to try and tackle this in Python... I'm not really totally sure what you are trying to do. Maybe you could describe your data in a little more detail or in something like pseudo code. –  GIS Danny Oct 13 '14 at 17:41
1  
Well a 'better solution' would be to use SQL and use tables that can be related via a relational database. SQL Server with native spatial data, and PostGIS of course... –  mapBaker Oct 13 '14 at 17:44
    
"Variable Substitution" may be needed. –  SIslam Dec 29 '14 at 14:15

1 Answer 1

I'm not sure if there's anything wrong with the text of the query itself, but, to avoid ModelBuilder freaking out on you, you'll need to set catid as a prerequisite to the Make Query Layer step.

If you set up a query or other operation in ModelBuilder that is dependent on a variable generated within the model itself, ModelBuilder will usually try to evaluate the dependent step before evaluating the value of the variable itself.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.