Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Length of LONG datatype - ANSWER !!!

RE: Length of LONG datatype - ANSWER !!!

From: Rusnak, George A. <rusnakga_at_hqlee.deca.mil>
Date: Wed, 20 Mar 2002 12:05:16 -0800
Message-ID: <F001.0042EEF5.20020320120516@fatcity.com>


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;

END; I added a VARCHAR2 column to my table and used the key_column to update the VARCHAR2 column with the length of the long_column. Don't ask why !!!

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


Do You Yahoo!?
Yahoo! Sports - live college hoops coverage http://sports.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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US