Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Increasing Field Width

Re: Increasing Field Width

From: Mark Malakanov <markmal_at_sprint.ca>
Date: Mon, 12 Jul 1999 21:22:45 -0300
Message-ID: <Wtwi3.11499$jl.17764451@newscontent-01.sprint.ca>


CREATE TABLE qqq (col char(2));

INSERT INTO qqq values ('qq');
COMMIT; ALTER TABLE qqq MODIFY (col varchar2(100));

But you can't reduce a size of column if its not empty.

[Modifying Column Definitions
You can use the MODIFY clause to change any of the following parts of a column definition:

datatype
size
default value
NOT NULL column constraint
The MODIFY clause need only specify the column name and the modified part of the definition, rather than the entire column definition.

Datatypes and Sizes
You can change a CHAR column to VARCHAR2 (or VARCHAR) and a VARCHAR2 (or VARCHAR) to CHAR only if the column contains nulls in all rows or if you do not attempt to change the column size. You can change any column's datatype or decrease any column's size if all rows for the column contain nulls. However, you can always increase the size of a character or raw column or the precision of a numeric column.

You cannot change a column's datatype to a LOB or REF datatype. ] Oracle Doc

Don Burton <dlburton_at_mindspring.com> wrote in message news:7me11k$ak9$1_at_nntp4.atl.mindspring.net...
> Hello,
>
> Somone told me that Oracle supports data structure changes (i.e. altering
> the width of a table field) w/o having to purge the table and reinsert
that
> data. Is this true.
>
> How does Oracle maintain data integrity based on that kind of model?
>
> Thanks.
>
>
>
Received on Mon Jul 12 1999 - 19:22:45 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US