Home » SQL & PL/SQL » SQL & PL/SQL » length of long data type (PL/SQL, SQL, Oracle)
length of long data type [message #384916] Thu, 05 February 2009 14:29 Go to next message
Messages: 4
Registered: July 2007
Location: India
Junior Member

Hi All
I wanted to find the maximum length of column which has data type as long..

suppose a table xyz has three columns a, b and c
and b is of long data type.
now i want the maximum characters in b column of table xyz.
As length (b) will not apply because of its data type..

Please help me..
and Thanks in advance..

Re: length of long data type [message #384929 is a reply to message #384916] Thu, 05 February 2009 15:00 Go to previous messageGo to next message
Michel Cadot
Messages: 65143
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Oracle says it since about 15 years: don't use LONG use CLOB.
You have to either convert your LONG into CLOB or read your own program if you want to know the size of a LONG.


[Updated on: Thu, 05 February 2009 15:00]

Report message to a moderator

Re: length of long data type [message #385029 is a reply to message #384916] Fri, 06 February 2009 04:29 Go to previous message
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
The easiest way I can think of would be this:
CREATE TABLE xyz2 as select a, to_lob(b),c from xyz;

SELECT max(length(b)) from xyz2;

Previous Topic: Retrieve Ton N rows using aggregate functions.(merged 3)
Next Topic: Update same record simultaneously from two calls to same procedure (merged)
Goto Forum:

Current Time: Sat Aug 19 08:17:25 CDT 2017

Total time taken to generate the page: 0.05537 seconds