edvhaller

ArcSDE C-API - SE_stream_calculate_layer_extent & SE_log_calculate_extent failure?

Discussion created by edvhaller on Aug 25, 2010
Latest reply on Aug 25, 2010 by vangelo-esristaff
Hello,

we are developing applications / tools with ArcSDE C-API - and got hit by an "old" problem again.
since ArcSDE 9.2? - SE_stream_calculate_layer_extent stopped working - with the errorcode SE_INVALID_PARAM_VALUE. (the trace logs don't tell much to give me a hint what parameter may be wrong, because it worked until ArcSDE 9.1.)
I have only found this thread in the old forum - but no final answer to it:
http://forums.esri.com/Thread.asp?c=158&f=2289&t=297835


Since ArcSDE 9.2 we used "SE_log_calculate_extent" as a workaround to get the extend of the selected features. But since the introduction of the ST_GEOMETRY as storage type this also stopped working - with an SE_INVALID_WHERE error.

As far we have found out the problem is not our where criteria - the statements which are build by ArcSDE Service seem to be wrong - in the ArcSDE log I have found the following entries for two different tests I have done.

[Wed Aug 25 11:22:02 2010] [8530] [tng3] ENVP_sqlstmt: SELECT /*+ LEADING INDEX(SCHMITT.SDE_logfile_data SCHMITT.SDE_LOGFILE_DATA_IDX1) INDEX(SCHMITT.SDE_logfile_data SCHMITT.SDE_LOGFILE_DATA_IDX2) * / MIN(a.SHAPE.minx), MIN(a.SHAPE.miny), MAX(a.SHAPE.maxx), MAX(a.SHAPE.maxy), MIN(a.SHAPE.minz), MAX(a.SHAPE.maxz) FROM  (SELECT DISTINCT logfile_data_id, sde_row_id FROM SCHMITT.SDE_logfile_data WHERE SCHMITT.SDE_logfile_data.logfile_data_id = :lf_data_id) LF_, SCHMITT.SDE_TEST a where  ( LF_.logfile_data_id = :lf_data_id and   LF_.sde_row_id = SDE_TEST.OBJECTID  ) and  a.SHAPE.entity != 0 and a.SHAPE.numpts != 0
[Wed Aug 25 11:22:02 2010] [8530] [tng3] SDE_Oracle Error: 904  ORA-00904: "SDE_TEST"."OBJECTID": ungültiger Bezeichner (invalid identifier)


here it seems "SDE_TEST.OBJECTID" must be replaced with "a.OBJECTID" then it will be ok? 


depending on what target type of log we are useing - it results into different errors like this one.

[Wed Aug 25 11:28:39 2010] [8531] [tng3] ENVP_sqlstmt: SELECT /*+ LEADING INDEX(SCHMITT.SDE_logfile_data SCHMITT.SDE_LOGFILE_DATA_IDX1) INDEX(SCHMITT.SDE_logfile_data SCHMITT.SDE_LOGFILE_DATA_IDX2) * / MIN(a.SHAPE.minx), MIN(a.SHAPE.miny), MAX(a.SHAPE.maxx), MAX(a.SHAPE.maxy), MIN(a.SHAPE.minz), MAX(a.SHAPE.maxz) FROM  (SELECT DISTINCT logfile_data_id, sde_row_id FROM SCHMITT.SDE_logfile_data WHERE SCHMITT.SDE_logfile_data.logfile_data_id = :lf_data_id) LF_, SCHMITT.SDE_TEST a where  ( LF_.logfile_data_id = :lf_data_id and  LF_.sde_row_id = SHAPE.fid) and  a.SHAPE.entity != 0 and a.SHAPE.numpts != 0
      [Wed Aug 25 11:28:39 2010] [8531] [tng3] SDE_Oracle Error: 904  ORA-00904: "SHAPE"."FID": ungültiger Bezeichner


here it seems "SDE_SHAPE.FID" must be also replaced with "a.OBJECTID" then it will be ok?


---
I have attached a Q&D Sample program as sourcefile - for this you will need a simple feature class with objectid and a spatial column (shape) - the geometrytype of the feature class doesn't matter.



Is this a known issue?
Is there a work around I haven't found yet?

with best regards

A. Weber

--
ArcSDE 9.3.1 SP2  (32bit)
Oracle 10.2.0.4     (64-bit on Windows 2008 Server 64-bit)
(we are useing dbinit.sde LOCAL= to establish the connection between ArcSDE and Oracle
- running on the same host)
Client SDE Libraries and Server Libraries are in sync - Same Versions.

Attachments

Outcomes