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
How can we create the complete backup of data in the oracle.
How to define an external table with a text file?
Can a formula column be obtained through a select statement ?
What are nested tables?
Can sub procedure/function be called recursively?
How can we find out the duplicate values in an oracle table?
Is a rollback possible to any savepoint?
What is a proxy class?
Define the SGA and: How you would configure SGA for a mid-sized OLTP environment? What is involved in tuning the SGA?
List the parts of a database trigger.
How to filter out duplications in the returning rows using oracle?
Differentiate between translate and replace?
How to use "in out" parameter properly?
What privilege is needed for a user to create indexes in oracle?
How to invoke the data pump import utility?