Data Types
CHAR(size) :- This data type is used to store character strings values of fixed length. The size in brackets determines the number of characters the cell can hold. The maximum number of characters this data type can hold is 255 characters.
VARCHAR(size) Or VARCHAR2(size) :- This data type is used to store variable length alphanumeric data. The maximum this data type can hold is 2000 characters. One difference between this data type and the CHAR data type is ORACLE compares VARCHAR values using non-padded comparison statements i.e. the inserted values will not be padded with spaces.
NUMBER(p,s) :- The NUMBER data type is used to store numbers . Numbers of vituality any magnitude may be stored up to 38 digits of precision . If precision is omitted values are stored with their original precision up to the maximum of 38 digits.
DATE:- This data type is used to represent date and time the standard forma is dd-mon-yy. To enter dates other than standard format use the appropriate functions. Date time stored date in the 24 hour format.
LONG:- This data type is used to store variable length character strings contains up to 2GB . LONG data can be used to store arrays of binary data in ASCII format. LONG values cannot be indexed and the normal character functions such as SUBSTR cannot be applied to long values.
RAW/LONG RAW:- The RAW/LONG RAW data types are used to store binary data such as digitized picture or image. Data loaded into columns of these data types are stored without any further conversion. RAW data type can have a maximum length of 255 bytes . Long raw data type can contain up to 2GB . Values stored in columns having LONG RAW data type cannot be indexed.
In addition to the above ORACLE 8,ORACLE 9i,ORACLE 11i supports the following data types.
LOB:- This is otherwise known as LARGE OBJECT data types this can store unstructured information such as sound clips, video etc. up to 4 gigabytes in size.
CLOB:- A column with this data type as CLOB stores characters objects with single byte characters. It contains character sets of varying widths. A table can have multiple columns with its data type as CLOB.
BLOB:- A column with this data type as BLOB can store large binary objects such as graphics, video clips and sound files. A Table can have multiple columns with BLOB as its data type.
BFILE:- A BFILE column stores file pointers to LOBs managed by file systems external to the database. A BFILE column may contain filenames for photos stored on a CD-ROM.
USER DEFINED DATA TYPES:- Like the oracle internal data types that are already present, the user can create new data types. These new data types use internal data types and other user defined type.
Syn:- Create or replace type <type name> as object (column data type,col2 datatype..)
Ex:- create or replace type vision as object (na varchar2(20),ci varchar2(20),pi number(6));
Note:- To execute the above example Objects Feature should be installed
For
Online Classes
Contact Us: +919885348743
Online Classes
Contact Us: +919885348743