upgrade to arcsde 10 - changes to arcobjects code

391
7
06-12-2012 06:24 AM
AshakaThakore
New Contributor II
Our DBA is going to upgrade arcsde from 9.3.1 to 10...

I have created my arcobjects tools (arcgis desktop) using arcobjects SDK for .Net framework , version of the arcobjects is 10.0.2414.

In my arcobjects code, I connect to the arcsde 9.3.1 geodatabase do some versioned edit/update etc, fetch some features using FeatureClass.Search methods etc.

Should I be concerend about anything for my arcobjects code if DBA upgrades ArcSDE to 10?  Will my code work in the same way?  thanks a lot
0 Kudos
7 Replies
VinceAngelo
Esri Esteemed Contributor
Your ArcObjects code should work, as long as you weren't doing anything unsupported,
like walking the list of feature classes via a OLEDB query on a GDB_* table. 

- V
0 Kudos
AshakaThakore
New Contributor II
thanks vince, I donot run oledb queries against GDB_ tables.

But  I do run OLEDB Query to access SDE.LAYERS table... I run SQL queries(by connecting through System.data.ORacleclient.oracleconnection in my arcobjects code)    to get Feature-table(F tables e.g. F120 etc) names for a featureclass.. 

Will that be a problem? Thanks
0 Kudos
VinceAngelo
Esri Esteemed Contributor
Why would you need this? It certainly isn't storage implementation safe
(ST_GEOMETRY doesn't have an F table, and ST_GEOMETRY is preferred
over SDELOB storage for most applications).

- V
0 Kudos
AshakaThakore
New Contributor II
in my arcobjects code, i need to find records in my layer that are missing locations. So after I find the F table name, I do this OLEDB query -
select * from mytable l ,f123  f where l.shape=f.fid and f.numofpts=0

Also, I saw that during the upgrade(on the testdata), my layer did not get moved to type - ST_Geometry
Is my code safe? 🙂

pl advise... thanks a lot
0 Kudos
VinceAngelo
Esri Esteemed Contributor
There's no need to do that join manually, since ArcSDE does it implicitly:

C:>sdequery -l simple1,shape -w "shape.numofpts = 0"

ArcSDE 10.0 Generic Query Tool           Wed Jun 13 08:03:27 2012
------------------------------------------------------------------------
         1
            OBJECTID: 1
               SHAPE: Nil shape

1 row found in 47.00 ms


The ST_GEOMETRY query for a NIL geometry (a shape without vertices) would be:

C:>sdequery -l simple2,shape -w "sde.ST_NUMPOINTS(shape) = 0"

ArcSDE 10.0 Generic Query Tool           Wed Jun 13 08:07:14 2012
------------------------------------------------------------------------
         1
            OBJECTID: 1
               SHAPE: Nil shape

1 row found in 281.00 ms


You could also do CLOB manipulation:

C:>sdequery -l simple2,shape -w "dbms_lob.substr(sde.ST_ASTEXT(shape),5) = 'EMPTY'"

ArcSDE 10.0 Generic Query Tool           Wed Jun 13 09:08:46 2012
------------------------------------------------------------------------
         1
            OBJECTID: 1
               SHAPE: Nil shape

1 row found in 1.15 secs


Upgrade doesn't change storage type -- You'd need to proactively change it ('sdelayer -o migrate')

- V
0 Kudos
AshakaThakore
New Contributor II
thanks V.. but I am using arcobjects c# .net how can i run sdequery command to retreive the objectid missign locations thanks a lot
0 Kudos
VinceAngelo
Esri Esteemed Contributor
You don't need to use 'sdequery' -- it's just a demonstration that the ArcSDE 'C' API
provides this capability.  Since ArcObjects wraps the 'C' API, you can use the same
WHERE clause with an ArcObjects cursor, avoiding the unsafe OLEDB call (you can
even determine the storage property of the feature class, and implement both query
constraints, depending on the layer's storage, which will put you on the path toward
using ST_GEOMETRY storage).

- V
0 Kudos