Home » SQL & PL/SQL » SQL & PL/SQL » Varchar2 Length
Varchar2 Length [message #609340] Wed, 05 March 2014 20:18 Go to next message
OraFaq13
Messages: 14
Registered: May 2013
Junior Member
Why Varchar2 needs the width while creating table.
CREATE TABLE W_APP_D
( app_number number,
  app_src varchar2
  );


This fails without width but gets compiled when you specify the length. I searched google and understand that varchar2 needs a width but couldn't find a reason for making it mandatory.

[Updated on: Wed, 05 March 2014 20:20]

Report message to a moderator

Re: Varchar2 Length [message #609342 is a reply to message #609340] Wed, 05 March 2014 20:22 Go to previous messageGo to next message
BlackSwan
Messages: 23070
Registered: January 2009
Senior Member
Oracle needs to know the maximum amount of space/characters that needs to be reserved.

Please read and follow the forum guidelines, to enable us to help you:

http://www.orafaq.com/forum/t/88153/0/
Re: Varchar2 Length [message #609360 is a reply to message #609340] Thu, 06 March 2014 00:32 Go to previous messageGo to next message
Michel Cadot
Messages: 59822
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Syntax is what it is no matter what you want it should be.
So you MUST provide a length; full stop.

If you don't agree then tell me the reason you can declare an integer as INTEGER or INT and not INTEG.

[Updated on: Thu, 06 March 2014 00:39]

Report message to a moderator

Re: Varchar2 Length [message #609436 is a reply to message #609360] Thu, 06 March 2014 11:46 Go to previous message
OraFaq13
Messages: 14
Registered: May 2013
Junior Member
Agree - Thank you for the clarification.
Previous Topic: Delete thousends of tables per script (without undo)
Next Topic: how to remove redundant data
Goto Forum:
  


Current Time: Sat Nov 29 02:02:12 CST 2014

Total time taken to generate the page: 0.08953 seconds