By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,924 Members | 1,651 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,924 IT Pros & Developers. It's quick & easy.

Equivalent of Oracle's DBMS_LOB.GETLENGTH(COLUMN_NAME)

P: n/a
Is there something equivalent to Oracle's

SELECT DBMS_LOB.GETLENGTH(COLUMN_NAME) FROM FOO

where COLUMN_NAME is a CLOB in table FOO

returning an integer with a count of the number of
characters ?

If there's no equivalent, might someone have
a user defined equivalent?

Thanks.

Nov 12 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
Incidentally,

LENGTH(COLUMN_NAME)

returns 86 for the CLOB type.

Nov 12 '05 #2

P: n/a
gi*******************@yahoo.com wrote:
Incidentally,

LENGTH(COLUMN_NAME)

returns 86 for the CLOB type.


In what version of DB2?

--
Daniel A. Morgan
University of Washington
da******@x.washington.edu
(replace 'x' with 'u' to respond)
Nov 12 '05 #3

P: n/a
gi*******************@yahoo.com wrote:
Incidentally,

LENGTH(COLUMN_NAME)

returns 86 for the CLOB type.

Works for me on DB2 V8 FP8 for LUW:

CREATE TABLE T1(c1 CLOB(10M));
INSRET INTO T1 VALUES '123456';
SELECT LENGTH(c1) FROM T1;
=> 6

Could it be your CLOB just happens to be 86 bytes long? ;-)

Cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #4

P: n/a
DA Morgan wrote:
gi*******************@yahoo.com wrote:
Incidentally,

LENGTH(COLUMN_NAME)

returns 86 for the CLOB type.


In what version of DB2?


LENGTH(<lob-value>) is available since V5 at least. The above result of 86
just says that the CLOB value stored in the column named COLUMN_NAME
happens to be 86 bytes long.

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #5

P: n/a
Knut Stolze wrote:
DA Morgan wrote:

gi*******************@yahoo.com wrote:
Incidentally,

LENGTH(COLUMN_NAME)

returns 86 for the CLOB type.


In what version of DB2?

LENGTH(<lob-value>) is available since V5 at least. The above result of 86
just says that the CLOB value stored in the column named COLUMN_NAME
happens to be 86 bytes long.


I would have assumed that but my impressio from the OP was that the 86
was in error. My query was only with respect to whether there was an
issue with LENGTH in a specific version.

Thanks.
--
Daniel A. Morgan
University of Washington
da******@x.washington.edu
(replace 'x' with 'u' to respond)
Nov 12 '05 #6

P: n/a
DA Morgan wrote:
Knut Stolze wrote:
DA Morgan wrote:

gi*******************@yahoo.com wrote:

Incidentally,

LENGTH(COLUMN_NAME)

returns 86 for the CLOB type.
In what version of DB2?


LENGTH(<lob-value>) is available since V5 at least. The above result
of 86
just says that the CLOB value stored in the column named COLUMN_NAME
happens to be 86 bytes long.

I would have assumed that but my impressio from the OP was that the 86
was in error. My query was only with respect to whether there was an
issue with LENGTH in a specific version.

Thanks.

Not to te hbest of my knowledge.

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #7

P: n/a
Serge Rielau wrote:
I would have assumed that but my impression from the OP was that the 86
was in error. My query was only with respect to whether there was an
issue with LENGTH in a specific version.

Thanks.


Not to te hbest of my knowledge.


Thanks.

--
Daniel A. Morgan
University of Washington
da******@x.washington.edu
(replace 'x' with 'u' to respond)
Nov 12 '05 #8

P: n/a
Indeed, the process transfering the data from Oracle was storing some
sort of 86 character string instead of the BLOB. So it works for me now
too.

Thanks Serge.

Nov 12 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.