Skip to content

Commit

Permalink
Support BLOB syncing on Oracle. Support the use of EMPTY_BLOB()
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed Sep 16, 2008
1 parent e537a58 commit 475f35a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
8 changes: 6 additions & 2 deletions symmetric/src/changes/changes.xml
Expand Up @@ -30,6 +30,10 @@
<action dev="chenson42" type="add" issue="aid=1956188&amp;atid=997724">
Support an initial load pushed from client to server.
</action>
<action dev="chenson42" type="fix">
Inactivating a sym_trigger by setting the inactive_time column to a non-null value
was fixed.
</action>
<action dev="chenson42" type="fix">
Fixed null pointer for blank my.url property. We now default my.url to blank in
symmetric-default.properties.
Expand Down Expand Up @@ -66,7 +70,7 @@
</action>
<action dev="chenson42" type="add">
Added a new plug-in point, the IBatchListener. This new interface gives the end user a chance to do
something with a group of data rows that are in the same batch. See XmlPublisher for an usage example.
something with a group of data rows that are in the same batch. See XmlPublisherFilter for an usage example.
</action>
<action dev="chenson42" type="add">
Added a new plug-in point, the IExtractorFilter. This new filter can be useful to capture and react to
Expand All @@ -77,7 +81,7 @@
</action>
<action dev="chenson42" type="add" issue="aid=1955378&amp;atid=997727">
Don't include the keys in data loader update statement if they haven't changed. This feature is turned
off by default and can be enabled by the new symmetric.runtime.dont.include.keys.in.update.statement
off by default and can be enabled by the new dont.include.keys.in.update.statement
parameter.
</action>
<action dev="chenson42" type="add" issue="aid=1955383&amp;atid=997727">
Expand Down
18 changes: 10 additions & 8 deletions symmetric/src/main/resources/dialects/oracle.xml
Expand Up @@ -33,14 +33,16 @@
v_buffer PLS_INTEGER := 999;
BEGIN
IF blob_in IS NOT NULL THEN
DBMS_LOB.CREATETEMPORARY(v_clob, TRUE);
FOR i IN 1..CEIL(DBMS_LOB.GETLENGTH(blob_in) / v_buffer)
LOOP
v_varchar := UTL_RAW.CAST_TO_VARCHAR2(UTL_ENCODE.base64_encode(DBMS_LOB.SUBSTR(blob_in, v_buffer, v_start)));
v_varchar := REPLACE(v_varchar,CHR(13)||CHR(10));
DBMS_LOB.WRITEAPPEND(v_clob, LENGTH(v_varchar), v_varchar);
v_start := v_start + v_buffer;
END LOOP;
IF DBMS_LOB.GETLENGTH(blob_in) > 0 THEN
DBMS_LOB.CREATETEMPORARY(v_clob, TRUE);
FOR i IN 1..CEIL(DBMS_LOB.GETLENGTH(blob_in) / v_buffer)
LOOP
v_varchar := UTL_RAW.CAST_TO_VARCHAR2(UTL_ENCODE.base64_encode(DBMS_LOB.SUBSTR(blob_in, v_buffer, v_start)));
v_varchar := REPLACE(v_varchar,CHR(13)||CHR(10));
DBMS_LOB.WRITEAPPEND(v_clob, LENGTH(v_varchar), v_varchar);
v_start := v_start + v_buffer;
END LOOP;
END IF;
END IF;
RETURN v_clob;
END fn_sym_blob2clob;
Expand Down

0 comments on commit 475f35a

Please sign in to comment.