|
|
Archives of the TeradataForum
Message Posted: Tue, 22 Apr 2003 @ 14:32:42 GMT
Subj: | | Why previous format of a varchar field is preserved after alter size of the column |
|
From: | | Anomy Anom |
<-- Anonymously Posted: Tuesday, April 22, 2003 10:02 -->
1) Step 1 : create a varchar column table.
BTEQ -- Enter your DBC/SQL request or BTEQ command:
ct var( i int, varfield varchar(10));
ct var( i int, varfield varchar(10));
*** Table has been created.
*** Total elapsed time was 1 second.
BTEQ -- Enter your DBC/SQL request or BTEQ command:
show table var;
show table var;
*** Text of DDL statement returned.
*** Total elapsed time was 1 second.
-------------------------------------------------------------------
CREATE SET TABLE WEEKLY.var ,NO FALLBACK ,
NO BEFORE JOURNAL,
NO AFTER JOURNAL,
CHECKSUM = DEFAULT
(
i INTEGER,
varfield VARCHAR(10) CHARACTER SET LATIN NOT CASESPECIFIC)
PRIMARY INDEX ( i );
2) Alter the varchar column to be of size 20.
BTEQ -- Enter your DBC/SQL request or BTEQ command:
alter table var add varfield VARCHAR(20);
alter table var add varfield VARCHAR(20);
*** Table has been modified.
*** Total elapsed time was 1 second.
BTEQ -- Enter your DBC/SQL request or BTEQ command:
3)
BTEQ -- Enter your DBC/SQL request or BTEQ command:
show table var;
show table var;
*** Text of DDL statement returned.
*** Total elapsed time was 1 second.
-------------------------------------------------------------------
CREATE SET TABLE WEEKLY.var ,NO FALLBACK ,
NO BEFORE JOURNAL,
NO AFTER JOURNAL,
CHECKSUM = DEFAULT
(
i INTEGER,
varfield VARCHAR(20) CHARACTER SET LATIN NOT CASESPECIFIC FORMAT
'X(10)')
PRIMARY INDEX ( i );
Can somebody explain me why the previous format is still preserved? I know that if in my alter table statement if I explicitly mention
the format as FORMAT 'X(20)') the modified format (x(20)) is accepted.
| |