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

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to change field size using SQL against an oracle Database

Re: How to change field size using SQL against an oracle Database

From: BookerT <chipw_at_ascac.org>
Date: 15 Dec 2006 04:01:43 -0800
Message-ID: <1166184103.143413.12680@j72g2000cwa.googlegroups.com>


Thanks,

Yes i ended up finding an old oracle 8 book in the office, and it said to do exactly what you typed. So yes, I quickly found out, my generic SQL book, just led me to the right neighborhood, but not on the same block :)

Thanks again Charles

Charles Hooper wrote:
> BookerT wrote:
> > I open up Oracle SQL*Plus and i want to change the field size for one
> > of my columns in one of my databases. I have a generic SQL book, but
> > when I try some of the commands, they don't seem to work in SQL*PLUS
> >
> > How can I perform this procedure on a table called INQUIRIES within my
> > database. I want to change the field size from 10 , to say , 60
>
> Generic SQL books will offer you a good start, but you will soon
> recognize that SQL statements and commands are not fully portable from
> one database platform to another.
>
> The command to alter a table's column width (field size, number of
> characters that can be stored) looks like this:
> ALTER TABLE
> MY_TABLE
> MODIFY (
> MY_COLUMN VARCHAR2(60));
>
> In the above, replace MY_TABLE with the appropriate table name, and
> MY_COLUMN with the appropriate column (field) name.
>
> > I even wanted to jus ttry the EXPLAIN command to view the table, but
> > when I type EXPLAIN INQUIRIES, i get a missing keyword error.
>
> DESC MY_TABLE
>
> The above command lists the columns in the table MY_TABLE and the
> maximum column sizes and numeric precision.
>
> SELECT
> *
> FROM
> USER_TABLES
> WHERE
> TABLE_NAME='MY_TABLE';
>
> The above lists information specific to the table: owner, number of
> rows, approximate row length, etc.
>
> SELECT
> *
> FROM
> USER_TAB_COLUMNS
> WHERE
> TABLE_NAME='MY_TABLE';
>
> The above lists all columns in the table, column order, and the maximum
> column sizes and numeric precision. Additionally, if statistics are
> collected, the minimum and maximum values for the column, density, and
> various other parameters.
>
> Charles Hooper
> PC Support Specialist
> K&M Machine-Fabricating, Inc.
Received on Fri Dec 15 2006 - 06:01:43 CST

Original text of this message

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