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
What is analyze command used for?
What are the advantages of oracle 12c?
Differentiate between post-database commit and post-form commit?
master table and child table performances and comparisons in Oracle ?
What are the different types of failures that occur in Oracle database?
What is oracle update statement with inner join ?
How to store only time; not date and time?
What are the uses of synonyms?
Hi this srilatha. I comlpeted my Oracle-hrms. can u provide me interview questions on Core hr, payroll,sshr,OLM etc..
Explain oracle data types with examples?
How to resolve name conflicts between variables and columns?
Explain drop constraint oracle?
How to define a variable to match a table column data type?
How does Oracle guarantee data integrity of data changes?
What is a connect identifier?