Connecting Tech Pros Worldwide Help | Site Map
 
 
LinkBack Thread Tools Search this Thread
  #1  
Old November 12th, 2005, 10:46 AM
gimme_this_gimme_that@yahoo.com
Guest
 
Posts: n/a
Default Equivalent of Oracle's DBMS_LOB.GETLENGTH(COLUMN_NAME)

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.

  #2  
Old November 12th, 2005, 10:46 AM
gimme_this_gimme_that@yahoo.com
Guest
 
Posts: n/a
Default Re: Equivalent of Oracle's DBMS_LOB.GETLENGTH(COLUMN_NAME)

Incidentally,

LENGTH(COLUMN_NAME)

returns 86 for the CLOB type.

  #3  
Old November 12th, 2005, 10:46 AM
DA Morgan
Guest
 
Posts: n/a
Default Re: Equivalent of Oracle's DBMS_LOB.GETLENGTH(COLUMN_NAME)

gimme_this_gimme_that@yahoo.com wrote:[color=blue]
> Incidentally,
>
> LENGTH(COLUMN_NAME)
>
> returns 86 for the CLOB type.[/color]

In what version of DB2?

--
Daniel A. Morgan
University of Washington
damorgan@x.washington.edu
(replace 'x' with 'u' to respond)
  #4  
Old November 12th, 2005, 10:46 AM
Serge Rielau
Guest
 
Posts: n/a
Default Re: Equivalent of Oracle's DBMS_LOB.GETLENGTH(COLUMN_NAME)

gimme_this_gimme_that@yahoo.com wrote:[color=blue]
> Incidentally,
>
> LENGTH(COLUMN_NAME)
>
> returns 86 for the CLOB type.
>[/color]
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
  #5  
Old November 12th, 2005, 10:47 AM
Knut Stolze
Guest
 
Posts: n/a
Default Re: Equivalent of Oracle's DBMS_LOB.GETLENGTH(COLUMN_NAME)

DA Morgan wrote:
[color=blue]
> gimme_this_gimme_that@yahoo.com wrote:[color=green]
>> Incidentally,
>>
>> LENGTH(COLUMN_NAME)
>>
>> returns 86 for the CLOB type.[/color]
>
> In what version of DB2?[/color]

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
  #6  
Old November 12th, 2005, 10:47 AM
DA Morgan
Guest
 
Posts: n/a
Default Re: Equivalent of Oracle's DBMS_LOB.GETLENGTH(COLUMN_NAME)

Knut Stolze wrote:[color=blue]
> DA Morgan wrote:
>
>[color=green]
>>gimme_this_gimme_that@yahoo.com wrote:
>>[color=darkred]
>>>Incidentally,
>>>
>>>LENGTH(COLUMN_NAME)
>>>
>>>returns 86 for the CLOB type.[/color]
>>
>>In what version of DB2?[/color]
>
>
> 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.[/color]

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
damorgan@x.washington.edu
(replace 'x' with 'u' to respond)
  #7  
Old November 12th, 2005, 10:47 AM
Serge Rielau
Guest
 
Posts: n/a
Default Re: Equivalent of Oracle's DBMS_LOB.GETLENGTH(COLUMN_NAME)

DA Morgan wrote:[color=blue]
> Knut Stolze wrote:
>[color=green]
>> DA Morgan wrote:
>>
>>[color=darkred]
>>> gimme_this_gimme_that@yahoo.com wrote:
>>>
>>>> Incidentally,
>>>>
>>>> LENGTH(COLUMN_NAME)
>>>>
>>>> returns 86 for the CLOB type.
>>>
>>>
>>> In what version of DB2?[/color]
>>
>>
>>
>> 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.[/color]
>
>
> 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.[/color]
Not to te hbest of my knowledge.

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
  #8  
Old November 12th, 2005, 10:48 AM
DA Morgan
Guest
 
Posts: n/a
Default Re: Equivalent of Oracle's DBMS_LOB.GETLENGTH(COLUMN_NAME)

Serge Rielau wrote:
[color=blue][color=green]
>> 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.[/color]
>
> Not to te hbest of my knowledge.[/color]

Thanks.

--
Daniel A. Morgan
University of Washington
damorgan@x.washington.edu
(replace 'x' with 'u' to respond)
  #9  
Old November 12th, 2005, 10:48 AM
gimme_this_gimme_that@yahoo.com
Guest
 
Posts: n/a
Default Re: Equivalent of Oracle's DBMS_LOB.GETLENGTH(COLUMN_NAME)

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.

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,174 network members.