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

How would you go about verifying the network name that the local_listener is currently using?

2101


How to create a stored procedure in oracle?

1148


How to connect asp pages to oracle servers?

1117


What operating systems are supported by oracle database 10g xe?

1082


How do you bind variables in oracle?

1015


Is oracle the best database?

1005


How to create id with auto_increment on oracle?

1034


Differentiate between pre-select and pre-query?

1149


What is the difference between PFILE and SPFILE in Oracle?

1105


How to define an oracle sub procedure?

1218


How to select some rows from a table in oracle?

1121


Explain the truncate in oracle?

1009


How to see the table columns used in an index?

1070


What is the data pump export utility?

1128


How can I create database in oracle?

1064