src/main/java/de/cimt/talendcomp/exasol/EXASCDHelper.java
String createSCD2Statement2(String source, String target) {
		StringBuilder sb = new StringBuilder();
		sb.append("merge into " + source + " ta using (\n");
		sb.append("SELECT " + getCslSourceString(true, false, false, false, false) + "\n");
		sb.append("FROM " + source);
		sb.append(" WHERE NOT EXISTS ( \n");
		sb.append("select 1 from " + target + "\n");
		sb.append("where " + getKeyClause(source, target));
		sb.append("\n)) sr\n");
		sb.append("on " + getKeyClause("sr", "ta") + "\n");
		sb.append("when matched then update set " + statusInTempTableColumn + " = 'NEW'");
		String sql = sb.toString();
		if (debug) {
			System.out.println("-- createSCD2Statement2");
			System.out.println(sql + ";");
		}
		return sql;
	}
/*
	 * SCD2 STEP 2) Mark all new entries in STAGE
	 */
SCD2 STEP 2) Mark all new entries in STAGE
SCD2 STEP 2 ) Mark all new entries in STAGE
String createSCD2Statement2(String source, String target) {
		StringBuilder sb = new StringBuilder();
		sb.append("merge into " + source + " ta using (\n");
		sb.append("SELECT " + getCslSourceString(true, false, false, false, false) + "\n");
		sb.append("FROM " + source);
		sb.append(" WHERE NOT EXISTS ( \n");
		sb.append("select 1 from " + target + "\n");
		sb.append("where " + getKeyClause(source, target));
		sb.append("\n)) sr\n");
		sb.append("on " + getKeyClause("sr", "ta") + "\n");
		sb.append("when matched then update set " + statusInTempTableColumn + " = 'NEW'");
		String sql = sb.toString();
		if (debug) {
			System.out.println("-- createSCD2Statement2");
			System.out.println(sql + ";");
		}
		return sql;
	}
String createSCD2Statement2 ( String source , String target ) { StringBuilder sb = new StringBuilder ( ) ; sb . append ( "merge into " + source + " ta using (\n" ) ; sb . append ( "SELECT " + getCslSourceString ( true , false , false , false , false ) + "\n" ) ; sb . append ( "FROM " + source ) ; sb . append ( " WHERE NOT EXISTS ( \n" ) ; sb . append ( "select 1 from " + target + "\n" ) ; sb . append ( "where " + getKeyClause ( source , target ) ) ; sb . append ( "\n)) sr\n" ) ; sb . append ( "on " + getKeyClause ( "sr" , "ta" ) + "\n" ) ; sb . append ( "when matched then update set " + statusInTempTableColumn + " = 'NEW'" ) ; String sql = sb . toString ( ) ; if ( debug ) { System . out . println ( "-- createSCD2Statement2" ) ; System . out . println ( sql + ";" ) ; } return sql ; }
SCD2 STEP 2) Mark all new entries in STAGE
SCD2 STEP 2 ) Mark all new entries in STAGE