title: oracle sql: insert spatial data from more existing table
body: <p>I have created a table <code>umriss</code> which I filled with data and I still need to insert the geometry data from existing tables (<code>usrdemo.glets_1850</code>, <code>usrdemo.glets_1973</code>, ...). How does that work?</p>
  
  <p><code>umriss</code> is a "weak entity" and has references to the tables <code>gletscherstand</code> (<code>glst_id</code>) and <code>gletscher</code> (<code>gletscher_id</code>)</p>
  
  <pre><code>create table umriss
  (
      umr_nr number (4) not null,
      umr_datum date,
      GLST_ID number (4) not null,
      shape mdsys.sdo_geometry,
      GLETSCHER_ID number (3) not null,
      se_anno_cad_data blob
  );
  
  alter table umriss
  add constraint umriss_glst_pk
  primary key (umr_nr, GLST_ID, GLETSCHER_ID);
  
  ALTER TABLE umriss 
  ADD CONSTRAINT umriss_gletscherstand_fk 
  FOREIGN KEY (GLST_ID, GLETSCHER_ID) 
  REFERENCES GLETSCHERSTAND(GLST_ID, GLETSCHER_ID);
  </code></pre>
  
  <p>I manually inserted the data for the attributes <code>umr_nr</code>, <code>umr_datum</code>, <code>glst_id</code> and <code>gletscher_id</code>. As you can see from <code>umr_nr</code> there are 3 shapes and I now want to add the spatial data from <code>usrdemo_glets_1850</code> which has 3 shapes and the attributes: <code>objectid</code> (= <code>umr_nr</code> in table <code>umriss</code>), <code>shape</code> and <code>se_anno_cad_data</code>. </p>
  
  <p>I tried this...</p>
  
  <pre><code>INSERT INTO umriss u
  (u.shape, u.se_anno_cad_data) 
  SELECT usrdemo.glets_1850.shape, usrdemo.glets_1850.se_anno_cad_data
  FROM usrdemo.glets_1850;
  </code></pre>
  
  <blockquote>
    <p>...and got the message: Ora-01400 - cannot insert NULL into ..."umriss"."umr_nr" </p>
  </blockquote>
  
  <p>How does this work?</p>