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...

What are Nested Tables? How will u delete 5 rows from Nested
Tables

Answer Posted / keshav

CREATE Or Replace TYPE AddressType AS OBJECT (
street VARCHAR2(15),
city VARCHAR2(15),
state CHAR(2),
zip VARCHAR2(5)
);

CREATE Or Replace TYPE nested_table_AddressType AS TABLE OF AddressType;

CREATE TABLE employee (
id INTEGER PRIMARY KEY,
first_name VARCHAR2(10),
last_name VARCHAR2(10),
addresses nested_table_AddressType
)
NESTED TABLE
addresses
STORE AS
nested_addresses;

INSERT INTO employee VALUES (
1, 'Steve', 'Brown',
nested_table_AddressType(
AddressType('2 Ave', 'City', 'MA', '12345'),
AddressType('4 Ave', 'City', 'CA', '54321')
)
);

DELETE FROM TABLE (
SELECT addresses FROM employee WHERE id = 1
) addr
WHERE
VALUE(addr) = AddressType(
'4 Ave', 'City', 'CA', '54321'
);

Is This Answer Correct ?    16 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does joining a thread mean?

1014


Which join is default?

947


How do you optimize a stored procedure in sql?

941


What is difference between rank () row_number () and dense_rank () in sql?

1097


what is meant by nl2br()? : Sql dba

1031


Where not exists in sql?

970


What is the difference between instead of trigger and after trigger?

997


Is there a 64 bit version of ssms?

954


Where can I learn sql for free?

980


What is a stored procedure in sql with example?

1115


Can we join two tables without common column?

998


What is the purpose of the partition table?

1041


What is the sql case statement?

984


Is sql pronounced sequel or sql?

1258


Can a trigger call a stored procedure?

1063