Want to Know about insert [message #515] |
Sun, 17 February 2002 20:02  |
M. AbdulSamadh
Messages: 1 Registered: February 2002
|
Junior Member |
|
|
Sir,
I would like to know how to insert a record at a specific position inbetween records
i.e if i have records like this with following order
computer
pc
windows
mediaplayer
now i would like to insert a record inbetween pc and windows
help me on this context
|
|
|
|
Re: Want to Know about insert [message #531 is a reply to message #515] |
Mon, 18 February 2002 17:31  |
seng
Messages: 191 Registered: February 2002
|
Senior Member |
|
|
Just a suggestion only, you need to create a procedure check and insert into between the records. The method is
1. duplicate record by record into temporary table and insert new record in wanted possition in temporary table.
2. After duplicate delete/truncate a source table.
Note:
- truncate will be faster and free certain level of space , but you can't rollback because it doesn't create redo log.
- delete will be slower and no freeup space.
- if the constraint is existed then the procedure
is more difficult and cause problem in your production database if user is using.
- cause performance issue if the table is huge.
3. copy record from temporary table to source table.
Note:
- cause performance issue if the table is huge.
4. you might have other better method then my suggestion.
Actually, i don't see your reason to insert record into between records. For your information ..
- sort in select statement to order the record.
- index your table if you want to query faster.
-
Hope this will help you. thanks
|
|
|