QUESTION:
I’m confused about how you’re supposed to link to SFs from EOs. You clearly link through table EO_SOURCE_FEATURE, but which fields to use is not clear to me. Can you please explain?
The intuitive fields in this table would be eo_id and source_feature_id (Method 1 below). But in some of your Biotics Help Desk solutions you link via shape_id (Method 2 below) instead and I've seen it demonstrated both ways. So far I’ve gotten the exact same results from both methods. Is there a reason to use the more complicated shape method? And why is there apparently duplicate information in the table?
--Method 1
select eosf.eo_id, sf.source_feature_id
from eo_source_feature eosf, source_feature sf
where
eosf.source_feature_id = sf.source_feature_id
and eosf.eo_id in(100309,668697);
--Method 2
select eo.eo_id, sf.source_feature_id
from eo, eo_source_feature eosf, source_feature sf
where
eo.shape_id = eosf.eo_shape_id
and eosf.source_feature_shape_id = sf.shape_id
and eo.eo_id in(100309,668697);
ANSWER:
As you have found, they both work. This is a remnant of Biotics 4, in which the only identifying foreign keys in the table were EO_SHAPE_ID and SOURCE_FEATURE_SHAPE_ID. It was decided to make it easier on everyone by adding EO_ID and SOURCE_FEATURE_ID to the table when we moved to Biotics 5. So, it's probably just a mix of new and old documentation. But depending on what other tables are being queried, it may be easier to use one over the other than doing yet another join.