Supposing i am using a table person, and persons might have multiple last names, so that attribute should be stored in a nested table (it's not about where to store last names), here is a simple sql for creating the type last name, the table person and adding an example row in oracle's sql developper (11G XE):
create type lastn as table of varchar2(10);
CREATE TABLE person
(
ID NUMBER NOT NULL
, last_name lastn
, CONSTRAINT EXEMPLE_PK PRIMARY KEY
(
ID
)
ENABLE
)nested table last_name store as ln;
insert into person values(1,ln('dani','bilel'));
I know how to update all last names at once, but i need to preserve existing last names and add other last names, or remove a single last name without affecting the others. In a nutshell, i want my code to be like (i am not familiar with PL/SQL):
update person set last_name=last_name+'third last name' where id=1;
I know that it doesn't work like that, should i use PL/SQL ?, isn't it posible other ways ?
Please excuse my question, and thank you for your response.