Icon View Incident Report

Serious Serious
Reported By: Fernando Dias
Reported On: 3/2/2009
For: Version 2.02 Build 8
# 2941 Concatenating Compressed CLOB Columns in SQL Can Cause Embedded NULL Byte Characters

I'm seeing embedded #0 characters in a clob column. After executing the following stored procedure, there are some extra characters in the text just before the '**the end**' string. As far as I could understand, this only happens if I use blob compression for Msg column.

PROCEDURE "TestClob" ()
BEGIN 
  DECLARE St VARCHAR;
  DECLARE Cur1 SENSITIVE CURSOR WITH RETURN FOR Sql1 ;
  
  -- Delete all rows then create a row
  EXECUTE IMMEDIATE 'DELETE FROM TestClob';
  EXECUTE IMMEDIATE 'ALTER TABLE TestClob ALTER Id RESTART WITH 0';
  EXECUTE IMMEDIATE 'INSERT INTO TestClob(Msg) Values ('''')';


  PREPARE Sql1 FROM 'SELECT Msg FROM TestClob WHERE Id = ?';

  -- Insert some text into the CLOB column
  OPEN Cur1 USING 1;
  FETCH FIRST FROM Cur1 ;
  SET St = 
    'This is line one.'+#13+#10+
    'And this one is the second... ' ;
  UPDATE Cur1 SET Msg = St ;

  -- Append text to CLOB
  OPEN Cur1 USING 1;
  FETCH FIRST FROM Cur1(Msg) INTO St;
  SET St = St + #13 + #10 + '**** THE END ****' ;
  UPDATE Cur1 SET Msg = St ;

  -- Return cursor
  UNPREPARE Sql1;
  PREPARE Sql1 FROM 'SELECT * FROM TestClob';
  OPEN Cur1;

END



Comments Comments
This issue only occurs with CLOB columns that are using compression.


Resolution Resolution
Fixed Problem on 3/2/2009 in version 2.02 build 9


Products Affected Products Affected
ElevateDB Additional Software and Utilities
ElevateDB DAC Client-Server
ElevateDB DAC Client-Server with Source
ElevateDB DAC Standard
ElevateDB DAC Standard with Source
ElevateDB DAC Trial
ElevateDB LCL Standard with Source
ElevateDB VCL Client-Server
ElevateDB VCL Client-Server with Source
ElevateDB VCL Standard
ElevateDB VCL Standard with Source
ElevateDB VCL Trial

Image