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: another newbie sql question , Re: ALTER

Re: another newbie sql question , Re: ALTER

From: Brian Peasland <peasland_at_edcmail.cr.usgs.gov>
Date: Tue, 30 Nov 1999 15:09:19 GMT
Message-ID: <3843E89F.EC61F001@edcmail.cr.usgs.gov>


If you do a describe on the table (DESC TEAMS) I'm sure you'll see that the column heading is just fine. When you do a query on the table in SQL*Plus, it takes the defined column length as the default display length. Since you defined DIVISION as 6 characters. When you query, it will display a column only six chars in length. To make the column 6 chars, it had to truncate the heading.

to resize the column:

   COLUMN division FORMAT a10 (for 10 characters) or

   COLUMN division HEADING div (to rename the column heading)

HTH,
Brian

Lee Gold wrote:
>
> (I'm using: SQL*Plus: Release 3.3.4.0.0 Personal Oracle7 Release
> 7.3.4.0.0 PL/SQL Release 2.3.4.0.0)
>
> QUES:
> note at very bottom, that the col heading "DIVISION" was truncated w/the
> "N" chopped off
> is there a linkage between the char(6) and the col heading?
> why'd it do that? ?
>
> SQL> CREATE TABLE TEAMS
> 2 (TEAMNO SMALLINT NOT NULL,
> 3 PLAYERNO SMALLINT NOT NULL,
> 4 DIVISION CHAR(6) NOT NULL,
> 5 PRIMARY KEY (TEAMNO) )
> 6 ;
>
> Table created.
>
> SQL> INSERT INTO TEAMS VALUES (1, 6, 'first');
>
> 1 row created.
>
> SQL> INSERT INTO TEAMS VALUES (2, 27, 'second');
>
> 1 row created.
>
> SQL> SELECT * FROM TEAMS;
>
> TEAMNO PLAYERNO DIVISI
> ------------- ---------------- --------
> 1 6 first
> 2 27 second
Received on Tue Nov 30 1999 - 09:09:19 CST

Original text of this message

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