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.
Error Query:
Error: 3706: Syntax error VARCHAR2 does not match defined type.
Correct Query:
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 source | Data type for Oracle 9i or 10g staging data source | Native type for DB2 staging data source | Data type for DB2 staging data source |
---|---|---|---|---|
BYTEINT | integer | NUMBER(38) | integer | VARCHAR(3) |
SMALLINT | integer | INTEGER | integer | INTEGER |
INTEGER | Integer | INTEGER | Integer | INTEGER |
DECIMAL | Decimal | NUMBER(18) | Decimal | DECIMAL(18,0) |
FLOAT | Float | FLOAT(126) | Float | DOUBLE |
CHAR | Varchar | VARCHAR2(n BYTE) | Varchar | VARCHAR(n BYTE) |
VARCHAR | Varchar | VARCHAR2(n BYTE) | Varchar | VARCHAR(n BYTE) |
LONG VARCHAR | Varchar | VARCHAR2(4000 BYTE) | Varchar | VARCHAR2(4000 BYTE) |
NUMERIC | Decimal | NUMBER(18) | Decimal | DECIMAL(18,0) |
REAL | Float | FLOAT(126) | Float | DOUBLE |
DATE | Date | VARCHAR2(25 BYTE) | Date | VARCHAR(25) |
TIME | Time | VARCHAR2(25 BYTE) | Time | VARCHAR(25) |
TIMESTAMP | DateTime | VARCHAR2(25 BYTE) | DateTime | VARCHAR(25) |
Comments
Post a Comment