I want a table like,
no name address
addr1 addr2
So i want columns like addr1,addr2 under address column.
Can one please answer me.
Advance Thanks.
Answer Posted / prabhudatta barick
--CREATE A OBJECT TO HOLD ADDRESS
CREATE OR REPLACE TYPE ADDRESSES AS
OBJECT(ADDRESS1 VARCHAR2(1000),
ADDRESS2 VARCHAR2(1000));
--CREATE TABLE
CREATE TABLE EMP (
EMPNO VARCHAR2 (5),
ENAME VARCHAR2 (30),
ADDR ADDRESSES);
--INSERT DATA
INSERT INTO EMP VALUES(0001,'PRABHUDATTA',ADDRESSES
('BANGALORE','KARNATAKA'));
COMMIT;
--SELECT DATA
SELECT EMPNO, ENAME,A.ADDR.ADDRESS1,A.ADDR.ADDRESS2 FROM
EMP A;
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
How to display employee records who gets more salary than the average salary in the department?
How many types of table in Oracle?
How to lock and unlock a user account in oracle?
defination of bitmap index
What is archive log in Oracle?
What is recovery manager in Oracle?
What are dml statements in oracle?
How to create a new user account in oracle?
What are the types of partitions in oracle?
How to create an oracle database?
How to call a sub procedure?
What is an oracle recycle bin?
What are set operators?
What is set operator oracle?
How to drop an index in oracle?