PostgreSQL Update Writer - Haufe-Lexware/haufe.no-frills-transformation GitHub Wiki
In order to update data on a PostgreSQL database, use the following target definition:
<Target config="[configuration]">postgres.update://table_name(key_field1, key_field2,...)</Target>The PostgreSQL Update Writer will attempt to update the records defined by the table_name (the name of the table to update) and the key_field values. These values will be used in a WHERE clause for the UPDATE statement.
For the configuration, there are two possibilities:
- Using a connection string directly
- Using a connection string which is located in a text file
Pass the connection string directly into the configuration of the source tag:
<Target config="Host=myServerAddress;Database=myDataBase;User ID=myUsername;Password=myPassword;">postgres.update://CreditStatements(StatementId)</Target>Parameters can be used inside the connection string, if needed.
Please note the use the substitution of the greater (>, >) operator in the SQL query (needed for XML compliance).
In order to read the connection string from a file, use the following syntax (using the @ character):
<Target config="@postgres_connection.txt">postgres.update://Contacts(ContactID, Revision)</Target>Sample content of the postgres_connection.txt file, also using a parameter (§env§):
Host=§env§;Database=myDataBase-§env§;User ID=myUsername;Password=myPassword;