object type [message #602947] |
Tue, 10 December 2013 08:58 |
|
aravindreddy.akiti
Messages: 14 Registered: October 2013 Location: hyderabad
|
Junior Member |
|
|
i created objects like below
1.create or replace type name_type as object
(first_name varchar2(10),
last_name varchar2(10)
);/
2.create or replace type address_type as object
(h_no varchar2(10),
building varchar2(10),
street varchar2(10)
);/
And here i created a table like below
create table details
(name name_type,
address address_type);
now i want to insert the data how do i insert the into the table
pls answer me
|
|
|
Re: object type [message #602949 is a reply to message #602947] |
Tue, 10 December 2013 09:05 |
ThomasG
Messages: 3211 Registered: April 2005 Location: Heilbronn, Germany
|
Senior Member |
|
|
Are you really sure you want to do that?
You can of course create and insert those types.
INSERT INTO details VALUES (
name_type('First','Last'),
address_type('fo','build','str')
);
But now how do you select it again? A lot of tools/drivers won't be able to. You can't really use the table over db links easily. In general it is a bad idea to store custom objects in tables, stick to standard types for storage or you will find yourself in a deep hole one day and no way to get out again.
|
|
|
|
|
|
Re: object type [message #602957 is a reply to message #602954] |
Tue, 10 December 2013 09:56 |
pablolee
Messages: 2882 Registered: May 2007 Location: Scotland
|
Senior Member |
|
|
aravindreddy.akiti wrote on Tue, 10 December 2013 15:50then what is the best way to store data
ThomasG wrote on Tue, 10 December 2013 15:05 stick to standard types for storage
|
|
|
|
|
Re: object type [message #602962 is a reply to message #602960] |
Tue, 10 December 2013 10:14 |
cookiemonster
Messages: 13920 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
We're not suggesting there's some other objecty way of storing the data.
We're suggesting you should store the data in normal columns in a normal table.
create table details
(first_name varchar2(10),
last_name varchar2(10),
h_no varchar2(10),
building varchar2(10),
street varchar2(10));
|
|
|