Writer Mode Specification
The Pervasive PSQL writer allows the user to specify a writer mode, which determines what database command should be issued for each feature received. Valid writer modes are INSERT, UPDATE and DELETE.
Writer Mode Constraints
In UPDATE and DELETE mode, the fme_where attribute always takes precedence over the pervasive_update_key_columns DEF line parameter. If both the fme_where attribute and the pervasive_update_key_columns DEF line parameter are not present, then UPDATE or DELETE mode will generate an error.
When the fme_where attribute is present, it is used verbatim as the WHERE clause on the generated UPDATE or DELETE command. For example, if fme_where were set to ‘id<5’, then all database records with field id less than 5 will be affected by the command.
When the fme_where attribute is not present, the writer looks for the pervasive_update_key_columns DEF line parameter and uses it to determine which records should be affected by the command. Please refer to DEF for more information about the mdb_update_key_columns DEF line parameter.
Writer Mode Selection
The writer mode can be specified at three unique levels. It may be specified on the writer level, on the feature type or on individual features.
At the writer level, the writer mode is specified by the WRITER_MODE directive. This directive can be superseded by the feature type writer mode specification.
Note: For more information on this directive, see the chapter Database Writer Mode.
At the feature type level, the writer mode is specified by the pervasive_writer_mode DEF line parameter. This parameters supersedes the WRITER_MODE directive. Unless this parameter is set to INSERT, it may be superseded on individual features by the fme_db_operation attribute. Please refer to the DEF line documentation for more information about this parameter.
At the feature level, the writer mode is specified by the fme_db_operation attribute. Unless the parameter at the feature type level is set to INSERT, the writer mode specified by this attribute always supersedes all other values. Accepted values for the fme_db_operation attribute are INSERT, UPDATE or DELETE.