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


Please Help Members By Posting Answers For Below Questions

How do I find my oracle client driver version?

522


How i can handle exception in large code like 1000 line without distrubing the code or without exception handler sction?

2722


1) WIll all the user get the DEFAULT profile, if their current profile got deleted at any point of time? 2) What are the Situation we need to MOVE the TABLE between T.spaces? 3) What is the use of MOVING the TABLE between SCHEMA'S? 4) What are the Table Clause, Segment Clause and the Datafile Clause which will override each other? 5) Explain SORT_AREA_SIZE of Tempfile to make UNIFORM SIZE

1578


An automatic job running via DBMS_JOB has failedKnowing only that its failed, how do you approach troubleshooting this issue?

1614


What is the relationship among database, tablespace and data file?

534






Why does oracle 9i treat an empty string as null?

535


How to see free space of each tablespace?

588


Explain what are synonyms used for?

600


What is key preserved table?

558


How to check your oracle database 10g xe installation?

577


Respected sir, Please send me technical questions related to oracle apps..

1372


How to calculate date and time differences in oracle?

527


What is merge in oracle?

554


What are the types of trigger in oracle?

571


Please explain oracle left join with an example?

583