Select to view content in your preferred language

SDE C API Application get FK Constaint violation

1939
1
09-12-2013 07:18 AM
RodneyLadner
New Contributor
I have an SDE C API application that is at least 10 years old.  It has been through three major Oracle upgrades and the same number of SDE upgrades.  It has worked fine until last month when an Oracle security patch was installed on the Oracle 11g databases.  Now I am getting a FK constaint violation between the business table and the associated F table.  If the constraint is disabled everything works fine.  I had the DBA switch the layer from normal_io to load_only_io and back to force a rebuild of the indices.  After that it worked until he noticed the contsrint was disabled and then enabled it in Oracle.  Now it doesn't work again.

Below is the code snippet.

int update_shape_column(SE_STREAM * update_stream,
   SHORT num_cols,    
   CHAR ** update_attrs,
   SE_SHAPE * shape,
   char * update_where_clause)
{
LONG rc = SE_SUCCESS;
SHORT shape_indicator;

shape_indicator = SE_IS_NOT_NULL_VALUE;



rc = SE_stream_update_table(*update_stream, "CATMAN.DATA_SET_TYPE_COVERAGE",
        num_cols, (const CHAR **) update_attrs, update_where_clause);
     if (rc != SE_SUCCESS)
{
  process_error(NULL, *update_stream, rc, "SE_stream_update_table");
  return rc;
}


rc = SE_stream_bind_input_column(*update_stream, 1, *shape, &shape_indicator);
     if (rc != SE_SUCCESS)
{
  process_error(NULL, *update_stream, rc, "SE_stream_bind_input_column");
  return rc;
}

shape_indicator = SE_IS_NOT_NULL_VALUE;



     /* Execute the query */
  rc = SE_stream_execute(*update_stream);
     if (rc != SE_SUCCESS)
{
  process_error(NULL, *update_stream, rc, "SE_stream_execute");
  return rc;
}



/* Reset the update stream */
rc = SE_stream_close(*update_stream, TRUE);

return rc;
}
0 Kudos
1 Reply
VinceAngelo
Esri Esteemed Contributor
Please use the "code" editor tag on source ("#" in the UI).

The source doesn't do much good without an indication of what the error is, and
at what point it was raised.  It also wouldn't hurt to specify what version of Oracle
is in use, and what version of ArcSDE is installed in the geodatabase, and what
version of the API is being used.

Note that the proper behavoir of ArcSDE is for the constraint to be disabled
at all times, except during load-only to normal-IO transition (when corruption
is checked), so the geodatabase has been corrupted by enabling the constraint.

- V
0 Kudos