ALTER Table in Teradata

One interesting thing I have noticed in Teradata. I have an existing table, I want to ADD one new column to it.

I have given below query. I am getting an error.

Resolution for Varchar


Error Query:
       
ALTER TABLE SAMPLES.LOAN_ACCOUNT
ADD MY_NEW VARCHAR2(1);
       

Error: 3706: Syntax error VARCHAR2 does not match defined type.


Correct Query:
       
ALTER TABLE SAMPLES.LOAN_ACCOUNT
ADD MY_NEW1 VARCHAR(1);
       


Comparison Oracle Vs DB2

Teradata ODBC Driver Type Native type for Oracle 9i or 10g staging data sourceData type for Oracle 9i or 10g staging data sourceNative type for DB2 staging data sourceData type for DB2 staging data source
BYTEINTintegerNUMBER(38)integerVARCHAR(3)
SMALLINTintegerINTEGERintegerINTEGER
INTEGERIntegerINTEGERIntegerINTEGER
DECIMALDecimalNUMBER(18)DecimalDECIMAL(18,0)
FLOATFloatFLOAT(126)FloatDOUBLE
CHARVarcharVARCHAR2(n BYTE)VarcharVARCHAR(n BYTE)
VARCHARVarcharVARCHAR2(n BYTE)VarcharVARCHAR(n BYTE)
LONG VARCHARVarcharVARCHAR2(4000 BYTE)VarcharVARCHAR2(4000 BYTE)
NUMERICDecimalNUMBER(18)DecimalDECIMAL(18,0)
REALFloatFLOAT(126)FloatDOUBLE
DATEDateVARCHAR2(25 BYTE)DateVARCHAR(25)
TIMETimeVARCHAR2(25 BYTE)TimeVARCHAR(25)
TIMESTAMPDateTimeVARCHAR2(25 BYTE)DateTimeVARCHAR(25)

Comments

Popular posts from this blog

SQL for Quantile Function in Teradata

3 Uses of SAMPLE function in Teradata

All You Need NULL Value Functions