Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
0002152: DDL errors on DB2 i5 AS/400
- Loading branch information
Showing
6 changed files
with
101 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
symmetric-client/src/main/java/org/jumpmind/symmetric/db/db2/Db2As400TriggerTemplate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package org.jumpmind.symmetric.db.db2; | ||
|
||
import org.jumpmind.symmetric.db.ISymmetricDialect; | ||
|
||
public class Db2As400TriggerTemplate extends Db2TriggerTemplate { | ||
|
||
public Db2As400TriggerTemplate(ISymmetricDialect symmetricDialect) { | ||
super(symmetricDialect); | ||
sqlTemplates.put("updateTriggerTemplate" , | ||
"CREATE TRIGGER $(schemaName)$(triggerName) " + | ||
" AFTER UPDATE ON $(schemaName)$(tableName) " + | ||
" REFERENCING OLD AS OLD NEW AS NEW " + | ||
" FOR EACH ROW MODE DB2SQL " + | ||
" BEGIN ATOMIC " + | ||
" IF $(syncOnIncomingBatchCondition) then " + | ||
" IF $(dataHasChangedCondition) THEN " + | ||
" INSERT into $(defaultSchema)$(prefixName)_data " + | ||
" (table_name, event_type, trigger_hist_id, pk_data, row_data, old_data, channel_id, transaction_id, source_node_id, external_data, create_time) " + | ||
" VALUES('$(targetTableName)', 'U', $(triggerHistoryId), " + | ||
" $(oldKeys), " + | ||
" $(columns), " + | ||
" $(oldColumns), " + | ||
" $(channelExpression), " + | ||
" $(txIdExpression), " + | ||
" $(sourceNodeExpression), " + | ||
" $(externalSelect), " + | ||
" CURRENT_TIMESTAMP); " + | ||
" END IF; " + | ||
" END IF; " + | ||
" $(custom_on_update_text) " + | ||
" END " ); | ||
|
||
} | ||
|
||
public boolean useTriggerTemplateForColumnTemplatesDuringInitialLoad() { | ||
return false; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters