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
Explain the characteristics of oracle dba?
Briefly explain what is literal? Give an example where it can be used?
I have a table called 'test' on source and target with same name, structure and data type but in a different column order. How can you setup replication for this table?
How oracle handles dead locks?
How to save query output to a local file?
What is a subquery in oracle?
What is a trigger oracle?
Her departmandaki isçilerden empno' su ikinci sirada olan isçilerin empno, deptno, hiredate, sira_no bigilerini döndüren sorguyu yaziniz?
What types of joins are used in writing subqueries?
How to use "startup" command to start default instance?
How to concatenate two text values in oracle?
How can I introduce multiple conditions in like operator?
What is literal?
What is a read write transaction in oracle?
What operating systems are supported by oracle database 10g xe?