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

Java to Oracle database Connection Using JDBC

Oracle database. // Java Program to Establish Connection  // in JDBC with Oracle Database // Importing database import java.sql.*; // Import...