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

Home -> Community -> Mailing Lists -> Oracle-L -> ядзХд: LONG or VARCHAR2(20

ядзХд: LONG or VARCHAR2(20

From: Андрей Николаевич Горюнов <Goryunov_at_braz.ru>
Date: Wed, 10 May 2000 12:38:21 +0900
Message-Id: <10493.105300@fatcity.com>


VARCHAR2 - Variable-length character string having maximum length size bytes. Maximum size is 4000, and minimum is 1(Oracle 8) LONG - Character data of variable length up to 2 gigabytes, or 2^31 -1 bytes

You must use VARCHAR2 instead of LONG in all cases when the length of text is allows You will be have a lot of advantages since

A table cannot contain more than one LONG column; LONG columns cannot be indexed;

LONG columns cannot appear in certain parts of SQL statements: WHERE, GROUP BY, ORDER BY, or CONNECT BY clauses or with the DISTINCT operator in SELECT statements SQL functions (such as SUBSTR or INSTR); expressions or conditions;
SELECT lists of queries containing GROUP BY clauses; SELECT lists of subqueries or queries combined by set operators; SELECT lists of CREATE TABLE ... AS SELECT statements; SELECT lists in subqueries in INSERT statements.

Goryunov Andrey
Oracle DBA
Department of Information Technologies
Bratsk Aluminum Smelter

>>> eric_fang_at_yahoo.com 10/05/00 12:54 >>>
we decide to use a field to store the URL in the database, it could be very long but most of them less that 2k characters. But some developers prefer to use VARCHAR2(2000). What's the advantage of using LONG v.s VARCHAR2(2000) or VARCHAR@(2000) v.s LONG?

Any opinion?
Thanks.

Eric Fang



Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger. http://im.yahoo.com/
-- 
Author: Eric Fang
  INET: eric_fang_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).
Received on Tue May 09 2000 - 22:38:21 CDT

Original text of this message

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