How can we manage the gap in a primary key column created
by a sequence?
Ex:a company has empno as primary key generated by a
sequence and some employees leaves in between.What is the
best way to manage this gap?
Answer Posted / poornima
using cursor we find the gap in sequence, but this method
is quite complicated and slow process...
so we use some analyical fuctions such as lead and lag as
{LEAD | LAG} (value_expression, offset, default)
OVER ([PARTITION BY expr] ORDER BY expr)
| Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
List out the difference between commit, rollback, and savepoint?
How to define a procedure inside another procedure?
what are steps for interface? where is exchange rate defined in which table?
How to omit columns with default values in insert statement in oracle?
What is save point in oracle database?
How to add a new column to an existing table with a default value?
What is tns name?
What are the attributes of cursor?
How do we get field detail of a table?
Can we store pictures in the database and if so, how it can be done?
How to test null values?
Explain the use of owner option in exp command.
List the various oracle database objects?
Explain a segment?
How do I limit the number of rows returned by an oracle query after ordering?