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
What is the difference between substr and instr?
What is a cursor variable?
Explain the blob datatype?
What are the differences between char and varchar2 in oracle?
Explain the use of Merge statement in oracle 11g
What is a sub query? What are its various types?
What are the attributes of cursor?
How to loop through data rows in the implicit cursor?
What are oracle functions?
What is a partition in oracle?
Who developed oracle & when?
Can select statements be used on views in oracle?
What is oracle rownum?
What is snapshot is too old? Give and example for better understand.
Is it possible to center an object horizontally in a repeating frame that has a variable horizontal size ?