1

I need to add a column with varchar2 data type in teradata sql ,

for example

ALTER TABLE table_name ADD column_name varchar2 (20); 

But in teradata its not taking varchar2 as a defined type name.

Mureinik
  • 277,661
  • 50
  • 283
  • 320
Ravi
  • 11
  • 1

2 Answers2

5

varchar2 is an Oracle-specific datatype, not defined in the ANSI SQL standard. You should use the standard varchar type instead:

ALTER TABLE table_name ADD column_name VARCHAR(20);
Mureinik
  • 277,661
  • 50
  • 283
  • 320
  • Here's a link to a list of Oracle to Teradata translation rules. https://teradataworld.wordpress.com/2013/10/27/oracle-to-teradata-migration-guidelines/ – Ben Jan 23 '16 at 19:25
1

I think you should use NVARCHAR(20) - pay attention to that extra N in the type name, as it allows you to store Unicode strings.

Community
  • 1
  • 1
Alexei - check Codidact
  • 20,117
  • 15
  • 137
  • 145