Question

Updating SDE Featureclass with a list of selected records

  • 30 April 2019
  • 3 replies
  • 4 views

Badge

Hi All,

 

I am trying to update an SDE featureclass with a list containing a selection of records in that featureclass. I'm a little stuck as to how I can update just the records in the list - there is only one field that requires updating in the featureclass. I feel I need to push the list into a parameter and have that parameter in the "SQL To Run Before Write" feature in the Writer.

Does this sound feasible or am I off track with this one? I'm sure there's a few ways to do this.

Any help with this would be appreciated.

Cheers,

Mike


3 replies

Userlevel 6
Badge +33

Not sure if I understand correctly, do you want to update some records in a FeatureClass? Many ways to do this but in general you can set the (Feature)Writers "Feature Operation" parameter from Insert to Update, then select the matching Column, like OBJECTID, and off you go.

If you have a list of features (id's) then just convert the list to features by a ListExploder.

If you want to update all records where ColumnA = "A", then remove OBJECTID and select ColumnA as matching Column and send only a feature containing the update.

updategdb2019.fmwt

Badge

Not sure if I understand correctly, do you want to update some records in a FeatureClass? Many ways to do this but in general you can set the (Feature)Writers "Feature Operation" parameter from Insert to Update, then select the matching Column, like OBJECTID, and off you go.

If you have a list of features (id's) then just convert the list to features by a ListExploder.

If you want to update all records where ColumnA = "A", then remove OBJECTID and select ColumnA as matching Column and send only a feature containing the update.

updategdb2019.fmwt

Thanks @nielsgerrits for those suggestions I had been fiddling with those settings but wasn't quite getting the results I was after.

 

Have a look at the workbench below and I hope it answers a few things. I am trying to update a series of proposed geotech test locations either as created, moved or superseded (in the example below it is just superseded). I read a spreadsheet which identifies which ones require superseding I then explode this into a list and want to select just those records in the SDE featureclass and update the field 'Current Status' with "Superseded". The red circle is where all the magic should happen I believe (or in the writer) - whether it is a SQL query in the writer or something else its beyond me at present.

Thanks again for your help with this and let me know if any lightning bolts hit you.

Mike

 

Userlevel 6
Badge +33

Thanks @nielsgerrits for those suggestions I had been fiddling with those settings but wasn't quite getting the results I was after.

 

Have a look at the workbench below and I hope it answers a few things. I am trying to update a series of proposed geotech test locations either as created, moved or superseded (in the example below it is just superseded). I read a spreadsheet which identifies which ones require superseding I then explode this into a list and want to select just those records in the SDE featureclass and update the field 'Current Status' with "Superseded". The red circle is where all the magic should happen I believe (or in the writer) - whether it is a SQL query in the writer or something else its beyond me at present.

Thanks again for your help with this and let me know if any lightning bolts hit you.

Mike

 

I'm sorry mate but I'm still not sure what the problem exactly is :) but lets find out.

I think you want to update certain records in the featureclass. I guess the log contains id's which exist in the featureclass as well? Do you want to update all fields and do these fields exist in the logfile as well? Or only a specific field?

Or do you want to have one FeatureWriter, doing inserts, updates and deletes, depending on the processing result? (fme_db_operation)

Why do we need the ListBuilder? I think you are used to traditional software where you send one "signal" which contains all features. In FME every record can be a "signal".

Can you share the workspace and a sample of the input? This is easier to work with.

Reply