Skip to main content

Ok, so on rare occasions it appears that a certain feature class gets corrupted in a file gdb. The data is still there but you can't edit or add new data to the table. What we do is manually delete the feature class from the gdb, then load a blank feature class template of the same name into that gdb, then add the data back.

What I would like FME to do is read the data from the feature class, delete said feature class from gdb, add blank template of feature class from another gdb, then insert the attributes from the original gdb into it. Is this possible?

Read attribute values from PIPELINE feature class in GDB 1

Delete PIPELINE feature class in GDB1

Add PIPELINE feature class from GDB 2 into GDB 1

Set values of PIPELINE in the newly created feature class of GDB 1

Thank you,

Chris

Hi @madwarren, I think it's possible with this procedure in a single workspace (FME 2016).

  1. Read all PIPELINE features from the GDB1 using a GDB Reader.
  2. Write them into a temporary dataset using a FeatureWriter.
  3. Read the PIPELINE features from the temporary dataset using a FeatureReader (connect the FeatureReader to the Summary port of the FeatureWriter).
  4. Write them into the GDB1 using a GDB Writer with 'Drop Table' option.

You can import the PIPELINE feature class from the GDB2 when adding the writer.

And set 'YES' to the 'Drop Table' parameter for the feature type, so that the existing PIPELINE feature class will be deleted from the GDB1 before writing.

I think it works theoretically, but am afraid that an unexpected error could occur when deleting the existing PIPELINE feature class, because it has been corrupted. So I would recommend you to create a backup of the GDB1 before running the workspace.


Hi @madwarren, I think it's possible with this procedure in a single workspace (FME 2016).

  1. Read all PIPELINE features from the GDB1 using a GDB Reader.
  2. Write them into a temporary dataset using a FeatureWriter.
  3. Read the PIPELINE features from the temporary dataset using a FeatureReader (connect the FeatureReader to the Summary port of the FeatureWriter).
  4. Write them into the GDB1 using a GDB Writer with 'Drop Table' option.

You can import the PIPELINE feature class from the GDB2 when adding the writer.

And set 'YES' to the 'Drop Table' parameter for the feature type, so that the existing PIPELINE feature class will be deleted from the GDB1 before writing.

I think it works theoretically, but am afraid that an unexpected error could occur when deleting the existing PIPELINE feature class, because it has been corrupted. So I would recommend you to create a backup of the GDB1 before running the workspace.

aah, it could be simpler if you use the FeatureHolder transformer.

  1. GDB Reader: Read the PIPELINE features from the GDB1.
  2. FeatureHolder: Hold all features till the last one arrived.
  3. GDB Writer: Write them into the GDB1 with 'Drop Table' option.

aah, it could be simpler if you use the FeatureHolder transformer.

  1. GDB Reader: Read the PIPELINE features from the GDB1.
  2. FeatureHolder: Hold all features till the last one arrived.
  3. GDB Writer: Write them into the GDB1 with 'Drop Table' option.

Thank you @takashi for all of your help!


aah, it could be simpler if you use the FeatureHolder transformer.

  1. GDB Reader: Read the PIPELINE features from the GDB1.
  2. FeatureHolder: Hold all features till the last one arrived.
  3. GDB Writer: Write them into the GDB1 with 'Drop Table' option.

Hi @takashi,

 

will this be also possible with relationships and domains?

I need to write a new data from .gdb "Set_A" into a "Set_B".

Till now we did it always manualy (deleted feature classes, relationships and domains from "Set A" and then with "copy" from "Set_B" pasted into a "Set_A")

now we want to do it automaticly (also automate it in FME Server), but we need to build the Workspace schema.

Do you have an Idea?

Thanks

 


Reply