Select to view content in your preferred language

Registering a view as a layer using the sdelayer command

4172
5
07-18-2011 08:13 AM
NicholleFrontin
New Contributor
Good day

A view was created with the sdetable command.  It was registered with ArcSDE as a table, Oracle View "ERGIS.ARCVW_BUILDING".

To see the view as a layer, it must be registered using the sdelayer command but on execution of this command the layer is not being created.  Please see attached screen shots.

Could anyone give guidance on what I could do to successfully execute this command.

Thanks
Nicholle
0 Kudos
5 Replies
JakeSkinner
Esri Esteemed Contributor
It looks you are missing a ',' between OBJECTID and SDE for the -C option.  Here is an example on registering a table:

SQL> CREATE TABLE building (OBJECTID INTEGER, shape SDE.ST_GEOMETRY);

SQL> INSERT INTO building VALUES (1, SDE.ST_Polygon ('polygon ((0 0, 0 10, 10 10, 10 0, 0 0))', 2));
SQL> INSERT INTO building VALUES (2, SDE.ST_Polygon ('polygon ((20 0, 30 20, 40 0, 20 0))', 2));
SQL> INSERT INTO building VALUES (3, SDE.ST_Polygon ('polygon ((20 30, 25 35, 30 30, 20 30))', 2));

SQL> create index bf_indx on building(shape) indextype is SDE.ST_spatial_index parameters = ('SDE.ST_grids=1,0,0 SDE.ST_srid=2');

$ sdelayer -o regiSDE.STer -l building,shape -e nac+ -C OBJECTID,SDE -P HIGH -t SDE.ST_GEOMETRY -i 5151 -u vector -p vector
0 Kudos
NicholleFrontin
New Contributor
Thanks JSkinn3 but I ended up with the same error "Cannot Create Layer".  "Object name is not a regular identifier for the underlying DBMS (-322). The current environment is Linux OS, ArcSDE 9.3.1 and Oracle 9i. Nicholle
0 Kudos
VinceAngelo
Esri Esteemed Contributor
The example above looks like a search and replace went hog-wild. It also doesn't take the fact that
you want to register a view into account (views require USER-set rowids). Try:

 
sdelayer -o register -l ARCVW_BUILDING,shape -e nac+ -C OBJECTID,USER -P HIGH -t ST_GEOMETRY -i 5151 -u ERGIS -p ERGISpass


Then again, if this view was created with 'sdetable -o create_view', and it didn't capture the
geometry column correctly, then you really need to start over with view creation. I generally
recommend that views involving SDE.ST_GEOMETRY (or MDSYS.SDO_GEOMETRY) columns be
constructed via SQL, and the result registered, rather than using 'sdetable -o create_view'.

If you give more details in ASCII (vice a Word document), you're more likely to get responses.

Keep in mind that Oracle 9i (and 10g) are no longer supported by Oracle, so it's going to be
more and more difficult for Esri to support ArcSDE on these older databases.

- V
0 Kudos
ChrisBeaudette
Frequent Contributor
Vince et al:

Is it possible to register a view that is not a spatial view (i.e. no GEOMETRY column) in the same way one would register a table in SDE?  I tried to do so in ArcCatalog and it returned the error:

Failed to register with Geodatabase.  Underlying DBMS error [ORA-00942: table or view does not exist]

This is using ArcSDE for Oracle v10 SP2 against Oracle 10g (which according to Vince's note may be obsolete).
0 Kudos
VinceAngelo
Esri Esteemed Contributor
The 'sdetable -o create_view' command exists to create spatially-aware views with
SDEBINARY or SDELOB storage.

The 'sdelayer -o register' command exists to synchronize native geometry (which includes
ST_GEOMETRY storage) with an existing ArcSDE instance.

There is no need to register a view which doesn't contain geometry with ArcSDE (which
will see it as a table as soon as it is created [provided it is limited to the supported column
types, of course]).  It is not possible to register views with the geodatabase, since ArcGIS
expects SDE-set registered rowid columns, and these are not possible with views.

While Oracle no longer supports 10gR2 databases, Esri does continue to support ArcSDE
in them at ArcGIS 10.  The last ArcSDE release to support Oracle 9iR2 was 9.3.1.  It's
not too early to be planning 11g  database transition.

- V
0 Kudos