Home » SQL & PL/SQL » SQL & PL/SQL » why use varchar2(4000)
why use varchar2(4000) [message #250489] Tue, 10 July 2007 04:30 Go to next message
ursg02
Messages: 10
Registered: July 2007
Location: Pune
Junior Member
Hi,
Just i want to question ?
why use varchar2(4000) data type
b'caz in my database ,i want print those colume is datatype varchar2(4000) in dba_source

desc dba_source
Name Null? Type
OWNER VARCHAR2(30)
NAME VARCHAR2(30)
TYPE VARCHAR2(12)
LINE NUMBER
TEXT VARCHAR2(4000)
Re: why use varchar2(4000) [message #250510 is a reply to message #250489] Tue, 10 July 2007 05:45 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Why not?

Regards
Michel
Re: why use varchar2(4000) [message #250515 is a reply to message #250510] Tue, 10 July 2007 05:54 Go to previous messageGo to next message
ursg02
Messages: 10
Registered: July 2007
Location: Pune
Junior Member
Hi,
my question is why use ?
Re: why use varchar2(4000) [message #250518 is a reply to message #250515] Tue, 10 July 2007 06:00 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
My answer is why not?

Regards
Michel

OK. To be clearer: precise your question. Say it another way. I don't understand your english.

Re: why use varchar2(4000) [message #250519 is a reply to message #250518] Tue, 10 July 2007 06:04 Go to previous messageGo to next message
ursg02
Messages: 10
Registered: July 2007
Location: Pune
Junior Member
Hi,
If you not understand these question , done send answer
Re: why use varchar2(4000) [message #250530 is a reply to message #250519] Tue, 10 July 2007 06:31 Go to previous messageGo to next message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
ursg02 wrote on Tue, 10 July 2007 12:04
Hi,
If you not understand these question , done send answer

Reel your neck in. Michel is one of this sites most prolific and helpful users. Your question makes no conceptual sense as Michel's answer indicates. Remember, people on this site are not paid to help you, so try to be a bit more polite in future.
Re: why use varchar2(4000) [message #250566 is a reply to message #250489] Tue, 10 July 2007 08:45 Go to previous messageGo to next message
Bill B
Messages: 1482
Registered: December 2004
Senior Member
Read about varchar2

http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/datatype.htm#sthref3780
Re: why use varchar2(4000) [message #250578 is a reply to message #250566] Tue, 10 July 2007 09:20 Go to previous messageGo to next message
ammishra
Messages: 179
Registered: January 2007
Location: india
Senior Member
pablolee !! i am agree with you but if Michel is not able to understand the question then he can ask directly without staring meaning less thread

--Yash
Re: why use varchar2(4000) [message #250593 is a reply to message #250578] Tue, 10 July 2007 10:40 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
If you can't understand my answer maybe you have to ask you why I am posting this way and maybe it comes into your mind this is because the question is ununderstandable.

Regards
Michel
Re: why use varchar2(4000) [message #250608 is a reply to message #250593] Tue, 10 July 2007 11:10 Go to previous messageGo to next message
MarcL
Messages: 455
Registered: November 2006
Location: Connecticut, USA
Senior Member
Quote:
ununderstandable.




Nice word :}}

[Updated on: Tue, 10 July 2007 11:12]

Report message to a moderator

Re: why use varchar2(4000) [message #250612 is a reply to message #250608] Tue, 10 July 2007 11:20 Go to previous messageGo to next message
DreamzZ
Messages: 1666
Registered: May 2007
Location: Dreamzland
Senior Member
Razz
Re: why use varchar2(4000) [message #250613 is a reply to message #250608] Tue, 10 July 2007 11:21 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Isn't it? Laughing

Re: why use varchar2(4000) [message #250617 is a reply to message #250593] Tue, 10 July 2007 11:35 Go to previous messageGo to next message
ammishra
Messages: 179
Registered: January 2007
Location: india
Senior Member
But Lot of other user also getting mail…they are expecting some meaningful replay instead of meaningful reply they are getting some irritating email..if you directly asked the user then he was not sent to you replay like this

Hi,
If you not understand these question , done send answer 


Due to this mail ‘pablolee’ sent mail ..after that I am sending some nonsense mail and you are reapplying these mails .so better that we can try to avoid this kind of thread


I am sorry if I am saying some thing wrong and plz close this thread

--Yash
Re: why use varchar2(4000) [message #250618 is a reply to message #250617] Tue, 10 July 2007 11:45 Go to previous messageGo to next message
DreamzZ
Messages: 1666
Registered: May 2007
Location: Dreamzland
Senior Member
Good boy Wink Embarassed
Re: why use varchar2(4000) [message #250620 is a reply to message #250617] Tue, 10 July 2007 11:56 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
ammishra wrote on Tue, 10 July 2007 18:35
But Lot of other user also getting mail…they are expecting some meaningful replay instead of meaningful reply they are getting some irritating email..if you directly asked the user then he was not sent to you replay like this

Hi,
If you not understand these question , done send answer 


Due to this mail ‘pablolee’ sent mail ..after that I am sending some nonsense mail and you are reapplying these mails .so better that we can try to avoid this kind of thread


I am sorry if I am saying some thing wrong and plz close this thread

--Yash


./fa/917/0/

Michel
Re: why use varchar2(4000) [message #250734 is a reply to message #250489] Wed, 11 July 2007 02:03 Go to previous messageGo to next message
Barbara Boehmer
Messages: 8625
Registered: November 2002
Location: California, USA
Senior Member
Oracle uses varchar2(4000) to allow a long line of code to be stored. You do not have to display it in one long line. You can format it from SQL*Plus using, for example:

SQL> COLUMN text FORMAT A40 WORD_WRAPPED
SQL> SELECT text FROM dba_source WHERE ...;


The above will display up to 40 characters per row, then continue on the next line, without separating a word between lines.

[Updated on: Wed, 11 July 2007 02:08]

Report message to a moderator

Re: why use varchar2(4000) [message #250743 is a reply to message #250734] Wed, 11 July 2007 02:25 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
I just tested with a procedure containing a line of source code longer than 4000 characters (single byte character set). USER_SOURCE (and SYS.SOURCE$) seem to truncate the code after 4000 characters and continue in the next line. My guess is that, and note that this is a guess only, Oracle just glues all lines together and parses them as a whole. Perhaps this is documented somewhere...

Why 4000? It is the maximum size of a VARCHAR2 in SQL.
Why VARCHAR2? It is Oracles native character data type. It takes less space than a CHAR (blank padded) and it can be used in regular queries, as opposed to LONGs or CLOBs.


MHE
Re: why use varchar2(4000) [message #250757 is a reply to message #250489] Wed, 11 July 2007 03:31 Go to previous messageGo to next message
michael_bialik
Messages: 611
Registered: July 2006
Senior Member
Trying to index VARCHAR2(4000) column may raise a problem.

Michael
Re: why use varchar2(4000) [message #250760 is a reply to message #250757] Wed, 11 July 2007 03:38 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
michael_bialik wrote on Wed, 11 July 2007 10:31
Trying to index VARCHAR2(4000) column may raise a problem.

Michael

I'm afraid that I'm missing the point, Michael. What does this have to do with the use of VARCHAR2(4000) in USER_SOURCE?

MHE
Re: why use varchar2(4000) [message #250895 is a reply to message #250489] Wed, 11 July 2007 14:16 Go to previous message
michael_bialik
Messages: 611
Registered: July 2006
Senior Member
I misunderstood the point (I was thinking the guy wanted to use it in his own table(s)).

Michael
Previous Topic: Trying to get info from Date field
Next Topic: updating 500,000 records 3,000 at a time
Goto Forum:
  


Current Time: Sat Dec 03 22:02:07 CST 2016

Total time taken to generate the page: 0.12775 seconds