Walk only tables and feature classes, excluding views

2076
3
04-19-2016 09:05 AM
BlakeTerhune
MVP Regular Contributor


When Walking an Oracle 11g Enterprise Geodatabase, is there a way to tell if the table or feature class you're on is actually a view? I was hoping that the canVersion dataset describe property would work, but apparently ArcGIS still thinks some views can be registered as versioned.

EDIT:

I did stumble across this SQL to find all the views in the (Oracle) database.

select owner||'.'||object_name as view_name

from all_objects

where object_type = 'VIEW'

I suppose I could just run that with arcpy.ArcSDESQLExecute() and then check if each object being walked is in the SQL result. Still interested in other options though.

Tags (2)
0 Kudos
3 Replies
JoshuaBixby
MVP Esteemed Contributor

arcpy.Describe.canVersion() is returning True for some of your views?  I can't say I tested all of our views, but I tested a random sampling across half a dozen enterprise geodatabases, and it always returned False.  I wonder under what conditions canVersion() returns True for a database view.

0 Kudos
BlakeTerhune
MVP Regular Contributor

Thanks for the comment, Joshua. I dug a little deeper and found that about one third of our views describe as canVersion True. I checked the sde.table_registry and all of those are also registered. None of the ones that describe as canVersion False are registered in sde.table_registry. Most of these views are very old and were created (before my time) with sde comand lines so I guess that makes sense. Maybe it's time to recreate all of these views with the right click option in ArcCatalog.

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

Yes, one of the downsides of continual and long upgrade paths, i.e., not all of the former functionality plays nice in the upgraded environment.  My guess is that you are correct, and that only views registered with the old SDE command line tools show up as version-able.  Recreating them might take a little time upfront, but having consistency in your environments has a lot of value.