Skip to main content
Question

Retrieve failed feature when inserting to Oracle Non-spatial writer

  • June 13, 2019
  • 1 reply
  • 10 views

Is there a way to retrieve the actual record that fails a database constraint when trying to insert in an oracle table (using Oracle Non-spatial writer) instead of the SQL statement?

It seems as if FME only outputs the SQL statement that fails and the oracle error message, but can't seem to find a way to get the actual record that fails a constraint.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

david_r
Celebrity
  • June 14, 2019

The challenge is that FME submits features in transaction blocks, and Oracle (and almost all other relational database) only checks constraints on commit. So when the error occurs, FME has already handed over a large-ish block of features (1000 by default) and therefore cannot immediately tell which feature is causing the error, unless Oracle does it in the error message.

The best practice solution is to import data into a staging schema that does not have any constraints, then manually check for data integrity before moving the data into the production schema (with the contraints).

Alternatively, you can set the writer transaction size to 1, that way you'll know which feature fails. However, it will be a lot slower.