How to access the current value and next value from a
sequence?

Answer Posted / shai

select *
from user_sequences;

The last_number column will display the number available
next.
if no_cache is used in sequence definition then you can
trust on last_number column from user_sequence.
But if cache is used then below will take place:

If Cache is 20 then last_number will display any number
within range of sequence currval+20

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you create an empty table from an existing table?

601


How can you get sql*loader to commit only at the end of the load file? : aql loader

560


how to analyze tables with 'mysqlcheck'? : Sql dba

553


what is a tablespace? : Sql dba

572


How do I view a table in sql?

551






Suppose a student column has two columns, name and marks. How to get name and marks of the top three students.

538


What has stored procedures in sql and how we can use it?

573


Is time a data type in sql?

488


Difference between global and parameter variables?

1466


What is the non-clustered index in sql?

596


What is assignment operator in pl sql?

576


What is the purpose of primary key?

541


Explian rowid, rownum? What are the psoducolumns we have?

583


C. Normalize the following data up to the 3rd Normal form. Create the tables and insert the data given. Emp_ID Name Dept_Name Salary Course_Title Date_Completed 100 Adam Marketing 48,000 SPSS 6/19/2008 Surveys 10/7/2008 140 Bob Accounting 52,000 Tax Acc 12/8/2008 110 Cathy IT SQL Server 1/12/2008 C# 4/22/2008 190 Dan Finance 150 Emily Marketing 55,000 SPSS 6/16/2008 42,000 Analysis 8/12/2008 Queries 1. Find all Names who have completed the SPSS Course. 2. Find employee with max salary. 3. Find employee with 2nd max salary. 4. Find all employees in Dept “Marketing”. 5. Find all the employees who have taken more than 2 courses. 6. Find all the employees who have completed the courses before month of September.

2181


What is a table partition?

616