title: Select nextval from a sequence with a variable name
body: <p>I'm working in an app where each user has an Id which is a consecutive number from a sequence, the sequence is not always the same. </p>
  
  <p>Let's say you have the sequence A with nextval set to 8 and sequence B with nextval set to 5. The app has to tell which sequence to use based in a set of rules, so the next entry can have the id 5 or 8 (It won't have any contraint issue beacuse the primary key is in another field). I'd like to use a single query like</p>
  
  <pre><code>SELECT NEXTVAL FROM ALL_SEQUENCES WHERE SEQUENCE_NAME = "";
  </code></pre>
  
  <p>But i can't figure out if thats even possible.</p>
  
  <p>I wouldn't like to concatenate the sequence name inside my app code as it breaks the pattern that i'm using for the rest of my queries.</p>