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
singhabm
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: 64103
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.

Regards
Michel

[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
JRowbottom
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: Update same record simultaneously from two calls to same procedure (merged)
Next Topic: LEFT Outer Join problem (merged 4)
Goto Forum:
  


Current Time: Sat Dec 03 07:46:54 CST 2016

Total time taken to generate the page: 0.17176 seconds