title: Trouble Understanding NEXTVAL and CURRVAL
body: <p>I did search for a similar question, but if I overlooked an existing answer I am glad to be redirected there.</p>
  
  <p>I am working to untangle an Oracle Stored Proceedure in a legacy system written by a long departed developer.</p>
  
  <p>The focus of the proceedure is to upload user data into the existing table structure in a bulk collection and save keystroke time adding 1-x-1 records.</p>
  
  <p>The procedure appears to work without error and the user group would like to expand it to allow additional data to load to separate but related tables.</p>
  
  <p>The author is using the NEXTVAL and CURRVAL commands to add primary key information as new records are added using the CSV data.</p>
  
  <p>But I am confused because my understanding of NEXTVAL/CURRVAL was that they required context and declaration to be used correctly.</p>
  
  <p>For example the Proceedure has the following:</p>
  
  <pre><code>SELECT seq_site.nextval INTO v_curr
  FROM DUAL;
  </code></pre>
  
  <p></p>
  
  <pre><code>UPDATE temp_table
  SET site_id = seq_site.currval
  </code></pre>
  
  <p>However [SEQ_SITE] is not declared anywhere in the preceding lines of the Procedure.</p>
  
  <p>Am I inferring correctly that the clause [SELECT seq_site.nextval INTO v_curr] is the declaration for [SEQ_Record_count]?</p>
  
  <p>(...v_curr is declared an integer early in the procedure declarations btw...)</p>