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

What is analyze command used for?

582


What are the advantages of oracle 12c?

557


Differentiate between post-database commit and post-form commit?

545


master table and child table performances and comparisons in Oracle ?

1668


What are the different types of failures that occur in Oracle database?

605






What is oracle update statement with inner join ?

585


How to store only time; not date and time?

557


What are the uses of synonyms?

609


Hi this srilatha. I comlpeted my Oracle-hrms. can u provide me interview questions on Core hr, payroll,sshr,OLM etc..

1659


Explain oracle data types with examples?

577


How to resolve name conflicts between variables and columns?

575


Explain drop constraint oracle?

593


How to define a variable to match a table column data type?

580


How does Oracle guarantee data integrity of data changes?

1938


What is a connect identifier?

543