title: How to manipulate objects with inheritance in sql (oracle)?
body: <p>Supposing that i have that hierarchy, how can i manipulate (add, edit) an agent or a client ?</p>
  
  <pre><code>CREATE TYPE TPRENOM AS varray(3) OF VARCHAR2(20);
  
  CREATE TYPE tadr as object(
    cp int  not null,
    state varchar2(20),
    city varchar2(20),
    street varchar2(20),
    doorNum int
  );
  
  create type tperson as object(
    fname varchar2(20),
    lname tprenom,
    adress tadr,
    phoneNum varchar2(10),
    email varchar2(50)
  )not final;
  
  create type tutilisateur under tperson(
    username varchar2(20),
    password varchar2(20)
  );
  
  create table agent(
    id_ag int not null,
    infos tutilisateur not null
    , CONSTRAINT agent_pk PRIMARY KEY 
      (
        ID_ag
      )
    enable
  );
  
  create table client(
  id_cl int  not null,
  infos tperson  not null,
  num_chec varchar2(30) not null,
   CONSTRAINT client_pk PRIMARY KEY 
    (
      ID_cl 
    )
    enable
  );
  </code></pre>
  
  <p>I've tried these, but it didn't work :</p>
  
  <pre><code>insert into agent values(1, tutilisateur( tperson( 'name', tprenom('bilel', 
  'dani','lastname3'), tadr(3,'state', 'miliana', 'hammama', 20), 
  '2140547854', 'email@gmail.com'), 'username', 'password'));
  
  insert into client values(0, tperson('name', tprenom('bilel', 'dani', 
  'lastname3'), tadr(3,'state2','miliana','hammama',20)),'123456789');
  </code></pre>
  
  <p>That's the error displaying when excecuting the sql above :</p>
  
  <blockquote>
    <p>Erreur SQL : ORA-02315: incorrect number of arguments for default constructor</p>
    
    <ol start="2315">
    <li>00000 -  "incorrect number of arguments for default constructor"</li>
    </ol>
    
    <p>*Cause:    The number of arguments specified for the default constructor
               doesn't match the number of attributes of the object type.</p>
    
    <p>*Action:   Specify the correct number of arguments for the default
               constructor and retry the operation.</p>
  </blockquote>
  
  <p>I'm i doing inheritance wrong ?</p>
  
  <p>Thanks for your response</p>