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 can we create the complete backup of data in the oracle.

2161


How to define an external table with a text file?

1070


Can a formula column be obtained through a select statement ?

2330


What are nested tables?

1178


Can sub procedure/function be called recursively?

1006


How can we find out the duplicate values in an oracle table?

1047


Is a rollback possible to any savepoint?

1098


What is a proxy class?

1059


Define the SGA and: How you would configure SGA for a mid-sized OLTP environment? What is involved in tuning the SGA?

2270


List the parts of a database trigger.

1053


How to filter out duplications in the returning rows using oracle?

1018


Differentiate between translate and replace?

1123


How to use "in out" parameter properly?

1050


What privilege is needed for a user to create indexes in oracle?

1028


How to invoke the data pump import utility?

1168