This is the site to help you

Discuss Various Data Types in Oracle.

by Your Name 0 comments

Tag


Share this post:
Design Float
StumbleUpon
Reddit

Data types come in several forms and sizes, allowing the programmer to create tables suited according to the project requirement.
It is important to know which data type should be used where and what its width should be given.
CHAR:

This data type is used to store character strings values of fixed length.
The size in brackets determines how many characters can be accommodated or held in particular column.
The maximum number of characters that can be hold in this data type is 255 characters.
The data held inside the particular column is always right padded to the length/size specified. Ex if the length of particular column is 30 and we are only entering 10 character name then remaining 20 character space will occupied by blank space.
It occupies more space in memory.
It is always specified inside in single quotes while inserting records in the table.

VARCHAR:

This data type is used to store variable length alphanumeric data.
It is more flexible form of CHAR data type.
The maximum this data type can hold up to 4000 characters.
The only difference between VARCHAR and CHAR data type is that this is not padded with length/size specified.Ex if the length of particular column is 30 and we are entering only 10 character name then remaining 20 characters space is not occupied by blank space.
It occupies less space in memory as compared to CHAR data type.
VARCHAR is usually wiser choice than CHAR due to its variable length format characteristics.
CHAR is much faster than VARCHAR.
It is always specified inside in single quotes while inserting records in the table.

DATE:

This data type is used to store date and time.
The standard format is DD-MON-YY as 15-JAN-08.
To enter dates other than standard format, use the appropriate functions.
The time is stored in 24-hour format.
By default the time in a date field is 12:00:00 am if no portion is specified.
The default date is the first day of the current month.
Valid dates range from January 1, 4712 B.C to December 31, 4712 A.D
It is always specified inside the single quotes while inserting records in a table.

NUMBER:

This data type is used to store numbers (fixed or floating point number).
Numbers up to 38 digits of precision can be stored.
Valid values are 0, positive and negative numbers with magnitude 1.0E-130 to 9.9…E125.
The precision (P) determines the maximum length of data whereas the scale (S) determines the number of places to the right of the decimal.
If the scale is omitted then the default value is zero.
If the precision is omitted then values are stored with their original precision up to maximum of 38 digits.
It is specified without any single quotes while entering records in a table.

LONG:

This data type is used to store variable length character strings containing up to 2 GB.
LONG data can be used to store arrays of binary data in ASCII format.
Only one LONG value can be defined per table.
It cannot be used in sub queries, functions, expressions, where clauses or indexes and the normal character functions such as SUBSTR cannot be applied to LONG values.
A table containing LONG value cannot be clustered.

RAW/LONG RAW:

This data type is used store binary data such as digitized image or image.
Data stored into the columns of these data types are stored without any further conversion.
RAW data type can have maximum length of 255 bytes.
LONG RAW data type can contain up to 2 GB.LONG RAW data type cannot be indexed.

Comments 0 comments

Feeds rss Hello, I am professor in Cushah college of management.

Harshit Mehta
A short description here
montu7777@gmail.com

Subscribe feeds via e-mail
Subscribe in your preferred RSS reader

Subscribe feeds rss Recent Entries

Advertise on this site Sponsored links

Categories

Sponsored Links

My Photos on flickr

Subscribe feeds rss Recent Comments

Technorati

Technorati
My authority on technorati
Add this blog to your faves