Here are some of the most commonly used datatypes:
CHAR is a fixed length datatype.If you don't specify a max size, it defaults to 1. The maximum size for a CHAR in a column is 2000 bytes.CHAR retains any data and space pads the values.
VARCHAR2 is a variable length string that must have it's maximum length declared before use.In Oracle 10g,a VARCHAR2 column may be up to 4000 bytes.In this the unused space is released back.
NUMBER(p,s) is a numeric data type having precision p and scale s.The precision p can range from 1 to 38.The scale s can range from -84 to 127.
EX:-Number(5,2) means 5 spaces will be alloted in which scaling is 2 digits and precision is 3 digits.Here scale indicates the number of digits that can be given after decimal point.
FLOAT datatype stores zero,positive,and negative floating-point numbers.It doesnt have any scaling factor and usually used in business.
DATE is a date datatype that has the ability to store the month,day,year, century,hours,minutes,and seconds.
When 2 DATE datatypes are substracted then,it gives the difference of days but when an exact difference is needed TIMESTAMP datatype helps.
TIMESTAMP datatype stores all the information that the DATE datatype stores,but also includes fractional seconds.
VARCHAR is not supported and is reserved for future use
Thursday, October 23, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment