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 the difference between truncate & delete command?
Explain what are the characteristics of data files?
If any one has information regarding interview of NIC (National Informatics Centre),it would be of great help...
What are the ansi data types supported in oracle?
What is connection pooling in oracle?
List the various oracle database objects?
How to create an initialization parameter file?
Can a parameter be passed to a cursor?
How to best split csv strings in oracle 9i?
How oracle handles dead locks?
Difference between cartesian join and cross join?
Is insert autocommit in oracle?
Where do we use decode and case statements?
What are dml statements in oracle?
If a parameter is used in a query without being previously defined, what diff. exist betw. report 2.0 and 2.5 when the query is applied ?