Every Variable has data type. Oracle provides many predefined data types or sub type.
PL/SQL supports four data type:
1. Scalar Data Type:
It holds a single value and it supports Boolean type.
Scalar Data Types are classified into four categories :
Example Of Sub type:
2. Composite Data Type:
In Composite datatype we can store whole row, if one row have three columns so we can store three values in a composite datatype variable at a time.
Type Of Composite Data Type :
3. Reference Data Type:
It holds values , acting as pointers which pointers to other data items like REF CURSOR.
4. LOB Data Type:
LOB data type hold values called Locators, which specifying the location of large objects like graphic images, video clips, and sound wave forms.
PL/SQL supports four data type:
- Scalar Data Type
- Composite Data Type
- Reference Data Type
- LOB Data Type
1. Scalar Data Type:
It holds a single value and it supports Boolean type.
Scalar Data Types are classified into four categories :
Data Type | Description |
---|---|
Numeric | Numeric data type is used for arithmetic operations like PLS_INTEGER, BINARY_INTEGER,NUMBER etc. |
Character | Alphanumeric value which represent single character or strings of characters or sub type like CHAR,VARCHAR2,NCHAR,NVARCHAR2 etc |
Boolean | Boolean data type are used for logical operations like TRUE and FALSE. |
Datetime | Date data type is used for store the date and time. |
Example Of Sub type:
DECLARE
SUBTYPE NAME IS char(20);
SUBTYPE MSG IS varchar2(100);
USER_NAME NAME;
WEL_MSG MSG;
BEGIN
USER_NAME := 'Reader ';
WEL_MSG := 'Welcome to the World of PL/SQL';
dbms_output.put_line('Hello ' || USER_NAME||' '|| WEL_MSG);
END;
SUBTYPE NAME IS char(20);
SUBTYPE MSG IS varchar2(100);
USER_NAME NAME;
WEL_MSG MSG;
BEGIN
USER_NAME := 'Reader ';
WEL_MSG := 'Welcome to the World of PL/SQL';
dbms_output.put_line('Hello ' || USER_NAME||' '|| WEL_MSG);
END;
2. Composite Data Type:
In Composite datatype we can store whole row, if one row have three columns so we can store three values in a composite datatype variable at a time.
Type Of Composite Data Type :
- RECORDS
- COLLECTIONS
It holds values , acting as pointers which pointers to other data items like REF CURSOR.
4. LOB Data Type:
LOB data type hold values called Locators, which specifying the location of large objects like graphic images, video clips, and sound wave forms.
latest content provided thank u so much oracle training in chennai
ReplyDelete