Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Length of LONG datatype - ANSWER !!!
DECLARE
my_long_var LONG; len_long_var VARCHAR2(10); CURSOR get_rec IS SELECT key_column, long_column FROM table_name ORDER BY key_column;
BEGIN
FOR x_rec IN get_rec
LOOP my_long_var := x_rec. long_column; len_long_var := LENGTH(my_long_var); dbms_output.put_line ('my_long_var = ' || LENGTH(my_long_var)); END LOOP;
Al Rusnak
804-734-8453
rusnakga_at_hqlee.deca.mil
-----Original Message-----
Sent: Tuesday, March 19, 2002 5:43 PM To: Multiple recipients of list ORACLE-L Subject: Re: Length of LONG datatype - ANSWER
I'll address your second question, because I don't know, offhand, the answer to the first!
IMO, there's almost no advantage to using LONG. There are many restrictions on its use (e.g., only one LONG in a table), you can't apply a function to a LONG column, you can't use it in a set operation, etc. In addition, Oracle says that the LONG datatype will soon be phased out.
If you can fit your data into 4000 or fewer characters, use VARCHAR2. If not, go for CLOB/BLOB, which require a little more overhead, but are much more useable than LONG.
Paul Baumgartel
Adept Computer Associates, Inc.
treegarden_at_yahoo.com
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Paul Baumgartel INET: treegarden_at_yahoo.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Rusnak, George A. INET: rusnakga_at_hqlee.deca.mil Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Wed Mar 20 2002 - 14:05:16 CST