How to insert records in the middle of the table? How to change the position of a column in the existing table or while creating a new column?

Questions by sat.inn   answers by sat.inn

Showing Answers 1 - 4 of 4 Answers

Hanu Ch rao

  • Mar 2nd, 2007
 

Hi,
Kindly give me Question Clearly.

  Was this answer useful?  Yes

Srinivas

  • Mar 22nd, 2007
 

Can u tell me how to insert a record in the middle of the table.

for example:- In a table there 4 records, say i want insert another record at 3rd position, is this possible? If yes can u help me in writting the query.

  Was this answer useful?  Yes

Madhu

  • Mar 23rd, 2007
 

Suppose a table dept contains 3 columns say deptno,dname and loc.If u want to change the order of dname and loc in reverse,then write  a query as follows



create table dept1 as  (select deptno,loc,dname from dept);


drop table dept;


create table dept as (select * from dept1);
 

  Was this answer useful?  Yes

gemini burj

  • Oct 23rd, 2007
 

As in case of normalization and properly index conditions and order of coulumns are not require to care the pointer of the new record created at last. This will be managed by the indexes and orders of the table. even then pointer is important in that case set order field is explicitly is created in the table and this field value is changed programatically and the records are shown by ordering of the field as per desire.

For creating a new columns in the table, upto oracle 9i is not directly possible but some script may help to have the order what is required. 1. alter the table with new columns(this will add the columns at last) then 2. Create a new table on the base of old table with the require ordering of the coulmns, 3. delete the old one and replace the new with the old one.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions