title: Insert in table, Sequence.nextval not working
body: <p>I have the following 3 tables, </p>
  
  <p><strong>Data_Excel</strong> contains the names, address, city and source of person; <br/>
  <strong>Person table</strong> has the name and ID;  <br/>
  I need to insert into <strong>person_location</strong> the address source, address, city and ID...</p>
  
  <p>I am using the following query :</p>
  
  <pre><code>CREATE SEQUENCE seq
  START WITH 6571
  MINVALUE 6571
  INCREMENT BY 1
  CACHE 100
  </code></pre>
  
  <p>&nbsp;</p>
  
  <pre><code>INSERT INTO Person (id,Name,source) 
  Select (seq.nextval),p_name,source 
  FROM Data_Excel 
  WHERE P_Name NOT IN 
  (SELECT name FROM Person) 
  GROUP BY P_Name,P_Address,P_city,Source 
  HAVING count(*) &lt; 2;
  </code></pre>
  
  <p>but I get the following error.
  I am using seq because ID is the primary key in persons but its not auto incrementing. I also tried that but there was an error :</p>
  
  <pre><code>02287. 00000 -  "sequence number not allowed here" 
  *Cause:    The specified sequence umber (CURRVAL or NEXTVAL) is inappropriate 
  here in the statement. 
  *Action:    emove the sequence number. 
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/AqmrH.png" alt="I have the following 3 tables, Data_Excel contains the names, address, city and source of person; Person table has the name and ID; I need to insert into person_location the address source, address, city and ID...where ID comes from person table and name that exist against the id should be matched in the data_excel table to get all the details "></p>