title: Inserting into Oracle the wrong way - how to deal with it?
body: <p>I've just found the following code:</p>
  
  <pre><code>select max(id) from TABLE_NAME ...
  
  ... do some stuff ...
  
  insert into TABLE_NAME (id, ... )
  VALUES (max(id) + 1, ...)
  </code></pre>
  
  <p>I can create a sequence for the PK, but there's a bunch of existing code (classic asp, existing asp.net apps that aren't part of this project) that's not going to use it.</p>
  
  <p>Should I just ignore it, or is there a way to fix it without going into the existing code?</p>
  
  <p>I'm thinking that the best option is just to do:</p>
  
  <pre><code>insert into TABLE_NAME (id, ... )
  VALUES (select max(id) + 1, ...)
  </code></pre>
  
  <p>Options?</p>