Solved

size of varchar2

Posted on 2013-12-10
5
508 Views
Last Modified: 2013-12-10
What is the max size of VARCHAR2? How many zeros it can hold? -
0
Comment
Question by:d27m11y
5 Comments
 
LVL 76

Assisted Solution

by:slightwv (䄆 Netminder)
slightwv (䄆 Netminder) earned 250 total points
Comment Utility
VARCHAR2 in a table or SQL: 4000 bytes.

In PL/SQL code: 32K.

The docs have this:
http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/datatypes.htm#CHDDCGEE

>>How many zeros it can hold?

As many as can fit given the constraints above and your character set?
0
 
LVL 8

Expert Comment

by:5teveo
Comment Utility
http://www.orafaq.com/faq/what_is_the_difference_between_varchar_varchar2_and_char_data_types

'Varchar2' appears to hold 4000 characters vs 2000 of 'varchar'
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
Comment Utility
>>'Varchar2' appears to hold 4000 characters vs 2000 of 'varchar'

Incorrect.  It's bytes not characters.  If the database is using a multi-byte characterset the maximum number of characters is reduced.  For example: a 2-byte characterset the maximum is 2000 characters.
0
 
LVL 73

Accepted Solution

by:
sdstuber earned 250 total points
Comment Utility
depends on the version.

up through version 7,  varchar2 had a limit of 2000 bytes
from version 8 through 11gR2  varchar2 has a limit of 4000 bytes

in 12c, default limit is 4000 bytes, but you can extend it to 32767 bytes but they are stored externally like LOB segments

All of those are for SQL limits.

In pl/sql, varchar2 can hold up to 32767 bytes
0
 
LVL 15

Expert Comment

by:Franck Pachot
Comment Utility
Hi,
As 'zero' is probably not a multibyte character, you can store 4000 of them. But I'm not sure it's a good idea to store zeros like that.
Regards,
Franck.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
ORACLE SQL DEVELOPER Query ? 5 57
Oracle SQL Select Statement 19 58
return result by latest date - oracle query 21 47
sql query 9 18
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to recover a database from a user managed backup

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now