Joining SDE feature class to SDE table fails in 10.2

3434
14
Jump to solution
11-21-2013 08:35 AM
WillAllender
New Contributor III
I originally posted this in Python, but maybe it makes more sense to put it here.  The Python workflow below also does not work if I take each step with ArcToolbox.  Simple workflow:
Grab a feature class and make a Feature Layer
Join a table to the Feature Layer

Is this workflow flawed?

>>> arcpy.MakeFeatureLayer_management(r'Database Connections\GISonGISWT.sde\GIS.V_NM_NIT_BRID_SDO_DT',"BRID_Decodes")
<Result 'BRID_Decodes'>
>>> arcpy.GetCount_management("BRID_Decodes")
<Result '203'>
>>> arcpy.AddJoin_management("BRID_Decodes","IIT_NE_ID",r'Database Connections\GISonGISWT.sde\GIS.XLAR_MV_RIL_BRID_DECODE',"IIT_NE_ID","KEEP_ALL")
<Result 'BRID_Decodes'>
>>> arcpy.GetCount_management("BRID_Decodes")
<Result '-1'>

That second GetCount should also result with 203 records, not -1.

Other rambling notes:
1) This workflow was built in ArcGIS Desktop 10.0 against a 9.3.1 database and works perfectly there. It fails in Desktop 10.1 with the same 9.3.1 database.
2) This workflow works fine using Desktop 10.2 on a 9.3.1 database.
3) This workflow fails if the database is at ArcGIS 10.2.
4) The join fields are both Long Integer.
5) The database is Oracle 11g on Sun OS.
6) If I move the join table to a file or personal GDB, the workflow works fine, even in 10.2. However, the Esri documentation states that the join table can be an SDE table, and I would prefer to not be copying a bunch of lookup tables to a local file. I need the above workflow to work on dozens of feature classes and tables.

Thanks in advance for any insight you have on this.

Cheers!
Will
0 Kudos
14 Replies
WillAllender
New Contributor III
Son of a b... that actually worked.  Converting to ST_GEOMETRY.  I would love to know how you arrived at that suggestion.

It doesn't help me with my ultimate/root problem, but it does somewhat help explain what's going on.  Root problem is that I am data mining someone else's SDE and they store in SDO, which I have no control or influence over.  So my test data is now invalid, but that is another issue.

Anyway, THANKS!
0 Kudos
AsrujitSengupta
Regular Contributor III
Adding more to what Vince already mentioned, you were actually hitting a known Bug:

NIM096131: Joining a table or a feature class through a field from another joined feature class or table returns ORA-25156 when the geometry storage SDELOB is used.

http://support.esri.com/en/bugs/nimbus/TklNMDk2MTMx

Glad you found the workaround!! Enjoy the weekend ahead!
0 Kudos
VinceAngelo
Esri Esteemed Contributor
You provided the answer in the SQL.   The join to the Fn table has the wrong syntax;
ST_GEOMETRY has no need to do that join.

- V
0 Kudos
MichaelVolz
Esteemed Contributor
Vince:

Is ESRI by any chance starting to migrate away from SDELOB geometry storage where only ST_GEOMETRY will be supported some time in the future?
0 Kudos
VinceAngelo
Esri Esteemed Contributor
They seem to have at 10.2 for PostgreSQL.  I'm not anywhere near the decision chain
to report the future, but there's strong benefits to not having a 3-table architecture,
so it's probably not a bad idea to plan for such a future.

- V
0 Kudos