Home » SQL & PL/SQL » SQL & PL/SQL » Want to Know about insert
Want to Know about insert [message #515] Sun, 17 February 2002 20:02 Go to next message
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 #520 is a reply to message #515] Mon, 18 February 2002 00:03 Go to previous messageGo to next message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member
Entering data in this way is not possible.you may delete all the record and start inserting again.
Re: Want to Know about insert [message #531 is a reply to message #515] Mon, 18 February 2002 17:31 Go to previous message
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
Previous Topic: how to get a result set from function or procedure?
Next Topic: Procedures
Goto Forum:
  


Current Time: Fri Mar 29 03:32:51 CDT 2024