Search This Blog

Thursday, September 12, 2024

Reorganize Oracle Database Table Column Position Without Recreating Table


Reorganize Column Position Without Recreating Table.

Step_1. 

Create a table:

CREATE TABLE test_table (

    a INT,

    b INT,

    d INT,

    e INT

);


Step_2.

Add a column:

ALTER TABLE test_table  ADD (c INT);


Step_3.

Move the column to the middle:

ALTER TABLE test_table  MODIFY (d INVISIBLE, e INVISIBLE);

ALTER TABLE test_table MODIFY (d VISIBLE, e VISIBLE);


Step_4.

DESCRIBE test_table;

Name

----

A

B

C

D

E

No comments:

Post a Comment

Check Difference Between Two Database Objects

Step-1. Create Two DBLINK to connect with Two Database then Step-2. define logindb= DBLINKONE define remotedb= DBLINKTWO define schema_name=...