Index: ../src-rep/src/apps/datastudio/com/aquafold/datastudio/tools/importtool/ImportThread.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- ../src-rep/src/apps/datastudio/com/aquafold/datastudio/tools/importtool/ImportThread.java (revision 57416) +++ ../src-rep/src/apps/datastudio/com/aquafold/datastudio/tools/importtool/ImportThread.java (revision ) @@ -32,6 +32,8 @@ import com.aquafold.aquacore.etl.ETLFileRecord; import com.aquafold.aquacore.etl.ETLInputFile; import com.aquafold.aquacore.etl.ETLUtil; +import com.aquafold.aquacore.open.rdbms.core.options.CoreOptionSettings; +import com.aquafold.aquacore.open.rdbms.core.options.CoreOptionSettingsDefaults; import com.aquafold.aquacore.open.rdbms.core.schema.AFBaseDBObject; import com.aquafold.aquacore.open.rdbms.core.schema.AFTable; import com.aquafold.aquacore.open.rdbms.core.schema.AFTableColumn; @@ -1106,14 +1108,15 @@ } } else if (ci._columnType == AFTableColumnInfo.BLOB) { + boolean binaryToHex = COptionSettings.getPropertyBool(CoreOptionSettings.RESULTS_RETRIEVE_BINARY_TO_HEX, CoreOptionSettingsDefaults.RESULTS_RETRIEVE_BINARY_TO_HEX); // Assume that it is a BLOB if (!cp.isCassandra()) { - sb.append("'"); + sb.append(binaryToHex && !cp.isOracle() ? (cp.isDB2() ? "blob(x'" : "x'") : "'"); } // Need to double the single quotes sb.append(AFResultValueUtil.processSingleQuotes(columnObject.toString(), escapeBackslash)); if (!cp.isCassandra()) { - sb.append("'"); + sb.append(binaryToHex && cp.isDB2() ? "')" : "'"); } } else if (ci._columnType == AFTableColumnInfo.NUMBER) { @@ -1568,11 +1571,13 @@ } } else if (ci._columnType == AFTableColumnInfo.BLOB) { + boolean binaryToHex = COptionSettings.getPropertyBool(CoreOptionSettings.RESULTS_RETRIEVE_BINARY_TO_HEX, CoreOptionSettingsDefaults.RESULTS_RETRIEVE_BINARY_TO_HEX); + byte[] bytes = binaryToHex ? AQHexUtils.hexToByte(columnObject.toString()) : columnObject.toString().getBytes(); if (cp.isOracle()) { - stmt.setBytes(idx, columnObject.toString().getBytes()); + stmt.setBytes(idx, bytes); } else { - stmt.setBlob(idx, new SerialBlob(columnObject.toString().getBytes())); + stmt.setBlob(idx, new SerialBlob(bytes)); } } else if (ci._columnType == AFTableColumnInfo.NUMBER) {