Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

How to display employee records who gets more salary than the average salary in the department?

1012


How many types of table in Oracle?

1075


How to lock and unlock a user account in oracle?

1038


defination of bitmap index

2057


What is archive log in Oracle?

1078


What is recovery manager in Oracle?

1001


What are dml statements in oracle?

1050


How to create a new user account in oracle?

964


What are the types of partitions in oracle?

982


How to create an oracle database?

982


How to call a sub procedure?

1045


What is an oracle recycle bin?

943


What are set operators?

1035


What is set operator oracle?

932


How to drop an index in oracle?

1027