Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Explain the function of optimizer in oracle?

1053


How to use "out" parameter properly?

1022


What are the different types of trigger and explain its various uses and functions?

1007


Explain what does a control file contain?

1031


How to create a new table in your schema?

1027


Explain what are the different type of segments?

911


What is the difference between substr & instr functions?

1119


What is hot backup and logical backup?

998


Can a formula column be obtained through a select statement ?

2263


What happens if you lost a data file?

977


Is oracle a relational database?

870


How to define a variable to match a table column data type?

936


What are the different types of record groups in oracle? Explain each of them

969


In XIR2 if we lost the administration password .How can we regain the password?thanks in advance.

1869


What is control file used for?

1097