SóProvas


ID
5266720
Banca
FGV
Órgão
IMBEL
Ano
2021
Provas
Disciplina
Banco de Dados
Assuntos

No âmbito do Oracle, analise o comando

 select xxxx.currval from dual
Assinale a opção que identifica corretamente a natureza do objeto xxxx.  

Alternativas
Comentários
  • ✅Gabarito(D)  

    Using Sequence Pseudo-columns

    After a sequence is created, you can use two pseudo-columns to access the sequence’s value:

    • NEXTVAL

    • CURRVAL

    You can reference these pseudo-columns in any SELECT, INSERT, or UPDATE statements. To retrieve a value from the INV_SEQ sequence, access the NEXTVAL value as shown:

    SQL> select inv_seq.nextval from dual;

    Now that a sequence number has been retrieved for this session, you can use it multiple times by accessing the CURRVAL value:

    SQL> select inv_seq.currval from dual;

    Fonte: Pro Oracle Database 11g Administration - Darl Huhn

  • CURRVAL: Retorna o valor atual de uma sequência