Home » SQL & PL/SQL » SQL & PL/SQL » Datatypes
Datatypes [message #266920] Wed, 12 September 2007 00:29 Go to next message
Messages: 2
Registered: April 2007
Location: CHENNAI
Junior Member
Hi buddies,

From one clients Create table scripts, i got the below syntax. What its all stanads for "Char(5 Char)".

SQL> create table testc(sss char(5 char));

Table created.


Re: Datatypes [message #266925 is a reply to message #266920] Wed, 12 September 2007 00:50 Go to previous messageGo to next message
Messages: 281
Registered: September 2004
Location: Dhaka, Bangladesh
Senior Member

SQL> create table testc(sss char(5 char));

Table testc will create with column sss. The sss column type is string and the length of the string will be fixed 5 charcters.
If you enter less then 5 characters then the string will right padded with space. e.g. abc will be "abc "
And if you try to enter more than 5 character it will raise an errors.

More about char datatype see the following document

Re: Datatypes [message #266980 is a reply to message #266920] Wed, 12 September 2007 03:06 Go to previous message
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
the "5 CHAR" syntax is used to specify the maximum length of the data that can be stored in the column.
You can specify column lengths in either BYTEs or CHARs. For a single-byte character set, there is no difference between them, but for a multi-byte character set it can make a big difference.
Previous Topic: insert statements
Next Topic: Privileges create any table
Goto Forum:

Current Time: Fri Oct 28 09:32:01 CDT 2016

Total time taken to generate the page: 0.07834 seconds