Skip to main content
Question

SQL Executor for creating unique IDs

  • October 6, 2014
  • 4 replies
  • 20 views

Forum|alt.badge.img+1
Hi,

 

 

I am using the SQL Executor transformer followed by Counter transformer to create unique IDs for new features that I am adding to an existing Oracle table.

 

 

The SQL Executor transformer fetches the maximum ID number in the existing table, and then the Counter transformer adds 1 to it.

 

 

However when I run the workbench the new features in the Oracle table have a geometry of NULL and in the FME log it says "Spatial Column 'GEOM' is NULL. Geometry will be updated to NULL."

 

 

I am wondering if it is something to do with the settings in the "combine attributes" or "combine geometry" options in the SQL Transformer. But I have tried a number of combinations of settings and cannot get it to work.  I only have the "Result" section of the SQL Executor transformer linked to the "Counter" if this is also part of the problem...

 

 

Does anyone have any ideas?
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.

4 replies

david_r
Celebrity
  • October 6, 2014
Hi,

 

 

I suspect you're on the right track about the "combine" settings. It should work if you set it up like this:

 

 

 

 

Tip: consider using an oracle sequence rather than the SELECT MAX(...) and Counter idiom. It is more robust and possibly also quicker.

 

 

David

Forum|alt.badge.img+1
  • Author
  • October 6, 2014
Hi David, 

 

 

Thanks for your reply.  Did you post a screen grab into your response with the set-up? If so, I can't see it due to browser issues.  Are you able to describe the set-up in words?

 

 

Thanks,

david_r
Celebrity
  • October 6, 2014
Hi,

 

 

try passing your features through one or two GeometryValidators.

 

 

David

Forum|alt.badge.img+1
  • Author
  • October 8, 2014
Hi David,

 

 

I tried that but it came up with no errors.  I ended up just using a Sequencer and Trigger in Oracle instead..  Still not sure what was wrong with the FME workbench though. Thanks,