Todd McNeill wrote:
Hi-
Is there an easy way to get the length of data stored in a CLOB
column, in bytes? Unfortunately, "SELECT LENGTH(clob_column) FROM
table" doesn't work.
What do you mean with "doesn't work"? Which error message do you get.
I'd guess that you have some sort of problem with your query because it
works quite fine for me:
$ db2 "create table a (a int, b clob(10M) )"
DB20000I The SQL command completed successfully.
$ db2 "insert into a values (1, repeat('x', 3000))"
DB20000I The SQL command completed successfully.
$ db2 "update a set b = b || b"
DB20000I The SQL command completed successfully.
$ db2 "update a set b = b || b"
DB20000I The SQL command completed successfully.
[...]
22 stolze@dolphin:~ $ db2 "select length(b) from a"
1
-----------
1536000
1 record(s) selected.
--
Knut Stolze
Information Integration
IBM Germany / University of Jena