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

Option

Type

Default

Description

dataSource

string

dataSource

Defines a Data Source name.

table

string

 

Defines a DB table.

mapper

string

 

Defines a data mapper.

dialect

string

MYSQL

Defines an SQL dialect. Possible values are:

  • MYSQL

  • ORACLE

  • DERBY

  • POSTGRESQL

  • SNOWFLAKE

businessKeys

string

 

Defines business keys.

outputTarget

string

 

Defines an output target for data in exchange. It can be stored in header, property or body.

outputTargetName

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}}&amp;skipHeaderRecord=false&amp;quoteDisabled=true&amp;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&amp;businessKeys=ORDER_REASON,SALES_ORG&amp;table=ORDER_REASON&amp;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