pfx-sql:upsert
Upsert works like pfx-sql:insert. The only difference is that when you use upsert, the row in the database table is updated based on business keys.
Properties
Option | Type | Default | Description |
---|---|---|---|
| string |
| Defines a Data Source name. |
| string | Â | Defines a DB table. |
| string | Â | Defines a data mapper. |
| string | MYSQL | Defines an SQL dialect. Possible values are:
|
| string | Â | Defines business keys. |
| string | Â | Defines an output target for data in exchange. It can be stored in header, property or body. |
| string | Â | Defines an output target name for the target type header and property. Name of the exchange header, name of the exchange property. |
Examples
<split streaming="true" stopOnException="true">
<tokenize token="\n" group="5000"/>
<log loggingLevel="INFO" message="Going to unmarshall ${property[CamelSplitIndex]}. batch of ORDER REASONS from CVS file" logName="pig.orderReasonCsvLoad"/>
<to uri="pfx-csv:unmarshal?header={{orderReasonData-header}}&skipHeaderRecord=false&quoteDisabled=true&delimiter=;"/>
<log loggingLevel="INFO" message="Unmarshalled ${property[CamelSplitIndex]}. batch of ORDER REASONS from CVS file successfuly" logName="pig.orderReasonCsvLoad"/>
<log loggingLevel="INFO" message="Going to load ${property[CamelSplitIndex]}. batch of ORDER REASONS to DB" logName="pig.orderReasonCsvLoad"/>
<to uri="pfx-sql:upsert?mapper=orderReasonMapper&businessKeys=ORDER_REASON,SALES_ORG&table=ORDER_REASON&dialect=POSTGRESQL"/>
<log loggingLevel="INFO" message="ORDER REASON data ${property[CamelSplitIndex]}. batch load to DB processed successfully" logName="pig.billingTransactionsCsvLoad"/>
</split>
Â
Â
IntegrationManager version 5.8.0