I have an interesting observation and wanted to share with you guys and see if you experience the same thing.
I am on ArcSDE 10.2, with Oracle 11.2.0.2.0, OS is RHEL6.1. I was excited that using ArcGIS for Desktop there is an option to create a database view. So I followed the steps listed here
http://resources.arcgis.com/en/help/main/10.2/index.html#/Create_a_database_view_in_ArcGIS_for_Deskt...
and created a simple database view of one of my SDE feature layers.
I also created a similar view using SDE command line tool like I used to do in 10.0 and before. Both methods created the views. However, I discovered that in the view created using the desktop tool, the objectID field data type is Long Integer, whereas the view created by the "traditional" SDE command line tool is ObjectID data type.
There are some advantages of having it as the "object ID" data type, especially using the view in ArcGIS services, etc.
I wonder if anybody else notice this? Is this "long integer" thing a bug? or is it by design choice? I hope to see some documentation about this, but haven't find any. I am very interested hearing how you guys think about this....
Thanks
Rong
I recently noticed something similar, with GUID type fields in Oracle. Using command-line tools results in a view with the same GUID types as the source tables. Using desktop results in a view with all GUID types converted to text. As GUIDs behave differently than text (importantly, what their respective string representation is), this is problematic.
My suspicion is that the columns in the view created using desktop either do not get inserted into COLUMN_REGISTRY, or they get inserted with the incorrect types. The actual database type is char(38), so without an entry in COLUMN_REGISTRY (or similar) there'll be no way for ArcGIS to know that this is meant to be a GUID. I'm just continuing to use command-line tools to create the views, for the time being.
John
They certainly should not be inserted into the COLUMN_REGISTRY, as that is an ArcSDE System Table. The tool you are using - Create Database View - is nothing but a "button" or "skin" to access RDBMS database functionality. It is not part of the ArcGIS Geodatabase realm, and hence it would be bad if it inserted data into the COLUMN_REGISTRY.
This may sound like a regression coming from the SDE Command Line tools, but this actually allows you to create (spatial) views in databases that are not "geodatabase enabled" and thus not "geodatabase aware", e.g. any "ordinary" non-GIS database you have on the shelves, like for customer data.
In addition, these tools were not really (or not only) designed to replace the ArcSDE Command Line tools, but to fulfil other ArcGIS users' needs.
Of course, you can do the same thing just as easy from your RDBMS management interface, like SQL Plus, SQL Server Management Studio etc, but this tool allows you to script it in Python using arcpy, or use it in ModelBuilder.
It is probably confusing because ArcGIS now contains both tools and menu options acting against geodatabases only, and tools working in mixed or non-geodatabase RDBMS systems, something many users still need to get accustomed too...
I'm using SQL to create a table in SQL Server with a geometry column. I need a way to automate registration of that table with the geodatabase. Using arcpy.RegisterWithGeodatabase_management doesn't work if the table is not populated; it complains that there is no geometry type specified.
I'm assuming that I would be able to do this using sdelayer -o register with the entity mask parameter, although I haven't tried. I would also be able to specify the spatial reference using the command line tool. The Register with Geodatabase tool, however, takes no parameters except for the input table.
Is there something I'm missing here, or is this another piece of functionality that isn't yet available in UI/GP/ArcPy?
Blair
Blair,
is there any reason why you are using SQL to create an empty table then register it with the geodatabase, rather than simply creating a feature class using python directly? RegisterWithGeodatabase is intended for registering existing (e.g. populated) tables, as opposed to brand-new empty ones that could simply be created using GP/UI/Python.
-Shannon