Home » RDBMS Server » Server Administration » How do I empty a column
How do I empty a column [message #373235] Thu, 05 April 2001 13:21 Go to next message
Linda
Messages: 22
Registered: July 2000
Junior Member
How do I empty a column to be able to decrease its size?
Re: How do I empty a column [message #373237 is a reply to message #373235] Thu, 05 April 2001 13:33 Go to previous messageGo to next message
Andrew again...
Messages: 270
Registered: July 2000
Senior Member
The only way I know of is to copy the data into a new table, drop the old column (or update it to set all values to null, "alter table t1 modify (col1...)" then copy the data in the temp table back again.
Re: How do I empty a column [message #373239 is a reply to message #373235] Thu, 05 April 2001 14:25 Go to previous messageGo to next message
Linda
Messages: 22
Registered: July 2000
Junior Member
Thank you, Andrew
Re: How do I empty a column [message #373265 is a reply to message #373237] Fri, 06 April 2001 17:30 Go to previous messageGo to next message
Subash Thatipalli
Messages: 2
Registered: April 2001
Junior Member
I Know another way for this Solution...

here iam taking EMP Table as a Example..in that table i want to make empname as empty... In that
query 10,10 is is the ename colume size then it creates lenth is 5
the solution is

Create table temp as Select empno,lpad(substr(ename,10,10),5) Ename,job,sal,comm,deptno,from Emp;
Re: How do I empty a column [message #373266 is a reply to message #373237] Fri, 06 April 2001 17:37 Go to previous message
Subash Thatipalli
Messages: 2
Registered: April 2001
Junior Member
I Know another way for this Solution...

here iam taking EMP Table as a Example..in that table i want to make empname as empty... In that
query 10,10 is is the ename colume size then it creates lenth is 5
the solution is

Create table temp as Select empno,lpad(substr(ename,10,10),5) Ename,job,sal,comm,deptno,from Emp;
Previous Topic: Multiple tables and commit
Next Topic: LOBS and CLOBS
Goto Forum:
  


Current Time: Mon Jul 01 17:38:26 CDT 2024