I have a DB2 table (9.5.1), which is defined as follows:
CREATE TABLE MY_TABLE ( ID INTEGER DEFAULT 0 NOT NULL, TEXT CLOB(104857600), PRIMARY KEY (ID) );
Now, if I want to request the actual text string stored in the CLOB, I do it like this:
select cast(t.TEXT as varchar(32000)) from MY_TABLE t where t.ID = 1;
The problem is that my text is truncated, but for varchar the maximum length is 32 KB, so this request fails:
select cast(t.TEXT as varchar(33000)) from MY_TABLE t where t.ID = 1;
Is there any other possibility, how can I get the full contents of the CLOB as text output?
Peter
source share