Question

Error when using private parameter as feature class name

  • 15 February 2019
  • 5 replies
  • 2 views

Badge

Hello,

 

When setting the Feature Class or Table Name field in an ArcSDE Feature Type writer as a parameter, e.g. 

$(str_table_prefix)_ALL

I get the following error:

Geodatabase Writer: Feature Class or Table 'OLDNAME_ALL' must exist when Table Handling is set to 'Truncate Existing'

Looking at the FMW file in Notepad, I notice that when I put a formula in the Feature Class or Table Name field, there are still a ton of references to the old value. If I put just a parameter (i.e. remove the _ALL suffix), the same thing happens. If I put just a plain string in this field, all of the old references are updated to the new string value.

 

If Table Handling is set to Create if Needed, the workflow runs, the expected table is created, and the data flows into it. But setting it to Truncate Existing will cause an error when running, if the table OLDNAME_ALL does not exist. If it does exist, then FME will truncate OLDNAME_ALL and then flow the data into NEWNAME_ALL. What?

 

FME ESRI Edition (v2018.0.0.3)


5 replies

Userlevel 6
Badge +31

It took me a moment or 2 to understand the issue. I am unable to reproduce this behavior using 2018.1.1.2 and a FileGeodataBase. Not having SDE available nor 2018.0.0 installed at the moment...

It really helps to attach a sample workspace to easily reproduce the error. This also prevents interpretation issues regarding the question.

Badge

It took me a moment or 2 to understand the issue. I am unable to reproduce this behavior using 2018.1.1.2 and a FileGeodataBase. Not having SDE available nor 2018.0.0 installed at the moment...

It really helps to attach a sample workspace to easily reproduce the error. This also prevents interpretation issues regarding the question.

Hi Niel,

I was able to reproduce this with the SDE and the FileGeodataBase. 

Steps taken:

  1. Run with Feature Class or Table Name = OLDNAME_ALL, and Table Handling = Create If Needed
  2. Add private parameter str_table_prefix with default value = NEWNAME
  3. Change Feature Class or Table Name = $(str_table_prefix)_ALL
  4. Run with Table Handling = Create If Needed
  5. After this, change Table Handling = Truncate Existing
  6. Ensure Writer Parameters have Transaction Type = Transactions
    • This is to ensure OBJECT_ID is reset in the feature class each run
  7. In ArcCatalog, delete table OLDNAME_ALL from the FileGeodataBase
  8. Run translation.

Error log:

[...]
FME has checked out an Esri license. The product checked out is 'Standard'
Installed ArcGIS version is '10.4'
Connected to the File Geodatabase at 'C:\Users\vm01\Desktop\TEST.gdb'
File Geodatabase release: '10.0'
Geodatabase Writer: Feature Class or Table 'OLDNAME_ALL' must exist when Table Handling is set to 'Truncate Existing'
A fatal error has occurred. Check the logfile above for details
A fatal error has occurred. Check the logfile above for details
Closing the Geodatabase writer
[...]

Here is a sample workspace requested. Examining the file in a text editor, there are still 4 references to OLDNAME_ALL.

none2geodatabase_file.fmw

Userlevel 6
Badge +31

Hi Niel,

I was able to reproduce this with the SDE and the FileGeodataBase. 

Steps taken:

  1. Run with Feature Class or Table Name = OLDNAME_ALL, and Table Handling = Create If Needed
  2. Add private parameter str_table_prefix with default value = NEWNAME
  3. Change Feature Class or Table Name = $(str_table_prefix)_ALL
  4. Run with Table Handling = Create If Needed
  5. After this, change Table Handling = Truncate Existing
  6. Ensure Writer Parameters have Transaction Type = Transactions
    • This is to ensure OBJECT_ID is reset in the feature class each run
  7. In ArcCatalog, delete table OLDNAME_ALL from the FileGeodataBase
  8. Run translation.

Error log:

[...]
FME has checked out an Esri license. The product checked out is 'Standard'
Installed ArcGIS version is '10.4'
Connected to the File Geodatabase at 'C:\Users\vm01\Desktop\TEST.gdb'
File Geodatabase release: '10.0'
Geodatabase Writer: Feature Class or Table 'OLDNAME_ALL' must exist when Table Handling is set to 'Truncate Existing'
A fatal error has occurred. Check the logfile above for details
A fatal error has occurred. Check the logfile above for details
Closing the Geodatabase writer
[...]

Here is a sample workspace requested. Examining the file in a text editor, there are still 4 references to OLDNAME_ALL.

none2geodatabase_file.fmw

Thanks for your very complete testcase :-) for now I only can say I am unable to reproduce your problem with 2018.1.1.2

Can you upgrade to the current version? Or are you tied to 2018.0.0.1 due to matching FME Server installation?

Badge +16

A wild guess here, but have you tried passing the parameter value to the feature writer as an attribute value with the ParameterFetcher?

Badge

A wild guess here, but have you tried passing the parameter value to the feature writer as an attribute value with the ParameterFetcher?

If I'm understanding you correctly, you're suggesting I use an attribute value in the place of the parameter value?

Using anything but a hard-coded string value in the Feature Class or Table Name field leaves the .fmw file looking pretty much the same as it does with a private parameter (i.e. there are still many references to the old name), which causes the issue to arise.

Reply