473,396 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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.

Nov 12 '05 #1
8 7505
Incidentally,

LENGTH(COLUMN_NAME)

returns 86 for the CLOB type.

Nov 12 '05 #2
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Thierry B. | last post by:
Hi, from SQL*Plus, i use: DESCRIBE MyTable and I get this result (example): Nom NULL ? Type ----------------------------------------- --------...
3
by: valexena | last post by:
Which Oracle dictionary view gives information about the position of a column in a primary key? -- Posted via http://dbforums.com
5
by: Madjid Nasiri | last post by:
Hi, I am basic in oracle. My Old programs write with Delphi and Databases: Access, Paradox, MySQL, Microsoft SQL. I write my code (SQL code) case-insensitivae, but now i need use oracle database....
2
by: Ted Theodoropoulos | last post by:
i have some linked tables to an oracle view in A2K using the ms oracle ODBC driver. i'm having a weird issue. the data in the tables seems to repeat. for example, if i run a query in a native...
2
by: pankaj_wolfhunter | last post by:
Greetings, In sybase there is a create default statement in order to create a default object. like CREATE DEFAULT one as 1 go this object then can be bound to different table columns as...
2
by: Florian Albrecht | last post by:
Hi there, as I am trying to write a recordset class, I am interested in fetching field information from an oracle db. Several information on the fields are very simple to request. So I already...
24
by: clinttoris | last post by:
Could some please finish this line of code. For the life of me whatever I try it does not work. I am trying to insert the current date time into oracle. Now I know that in oracle if I run ...
8
by: cbtguy_2000 | last post by:
Is it possible to execute the DESC tablename command using PHP to a Oracle DB or is that a *SQLPlus command?
0
amitpatel66
by: amitpatel66 | last post by:
GENERAL Functions: NVL(column_name, m) - Returns m if column_name value is NULL SELECT NVL(empno,0) FROM emp -- returns 0 if empno is NULL NVL2(column_name,c1,c2) - Returns c1 if...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.