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 about your project and its relation to the current job position you are applying to?

1011


20. Using a set operator, display the client number of all clients who have never placed an order.

2187


What is the difference between 10g OEM and 11g OEM?

965


What is the maximum limit on the number of columns in a table?

1086


What are named parameters?

1093


how to make an oracle object

2359


How would you change old and new values in an insert, delete and update triggers?

1022


Explain what are synonyms used for?

1034


What privilege is needed for a user to delete rows from tables in another schema?

1070


How would you best determine why your MVIEW couldnt FAST REFRESH?

1889


What is a subquery?

1122


What is oracle open database communication (odbc)?

1028


what is dynamic SGA and static SGA

4417


What is ordinary table in oracle?

1159


Why do we use bulk collect in oracle?

1058