Hi,
I want table structure shown below. How can i create this ?
Num Name Address
Addr1 Addr2


I want Addr1 and Addr2 under Address column.
How can i achive this ? Is it possible ?

Answer Posted / begum

hi this is really work

create type addr as object (
add1 varchar2(15),
add2 varchar2(15));
/
create table nest1 (
id number(2),
name varchar2(10),
address addr);

insert into nest1 values(10,'uma',addr('10th
main','bangalore'));
/
insert into nest1 values(20,'sami',addr('77g
colony','chennai'));

SQL> select * from nest1;

ID NAME
---------- ----------
ADDRESS(ADD1, ADD2)
--------------------------------------------
10 uma
ADDR('10th main', 'bangalore')

20 sami
ADDR('77g colony', 'chennai')

Is This Answer Correct ?    12 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is partitioning? Types of partitioning. explain? what is the new kind of partitioning type introduced in 9i?

1843


What is PL/SQL ?

1106


Give the advantages and disadvantages of clusters.

568


What are the differences between date and timestamp in oracle?

549


What are the limitations of check constraint?

559






Can I create users through internet explorer in oracle 10g?

563


What is Virtual Private Database in Oracle?

609


Can we create database in oracle using command line ?

578


What is oracle used for?

528


What exactly do quotation marks around the table name do?

540


How do I uninstall oracle client from windows?

532


Why use resource manager in Oracle?

657


Query to retrieve record for a many to many relationship ?

2077


Which is faster join or subquery in oracle?

531


What is the difference between post-database commit and post-form commit?

511