5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-04 01:32:20 +08:00

SQOOP-2990: Sqoop(oracle) export [updateTableToOracle] with "--update-mode allowinsert" : app fails with java.sql.SQLException: Missing IN or OUT parameter at index

(Sowmya Ramesh via Venkat Ranganathan)
This commit is contained in:
Venkat Ranganathan 2016-11-11 14:06:21 -08:00
parent 68f76982a0
commit 7d6667ddb6

View File

@ -71,7 +71,7 @@ protected String getUpdateStatement() {
// lookup table for update columns // lookup table for update columns
Set<String> updateKeyLookup = new LinkedHashSet<String>(); Set<String> updateKeyLookup = new LinkedHashSet<String>();
for (String updateKey : updateCols) { for (String updateKey : updateCols) {
updateKeyLookup.add(updateKey); updateKeyLookup.add('"' + updateKey + '"');
} }
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
@ -85,7 +85,7 @@ protected String getUpdateStatement() {
} else { } else {
sb.append(" AND "); sb.append(" AND ");
} }
sb.append(updateCols[i]).append(" = ?"); sb.append('"' + updateCols[i] + '"').append(" = ?");
} }
sb.append(" )"); sb.append(" )");