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
  • 297,002
  • 52
  • 306
  • 350
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
  • 297,002
  • 52
  • 306
  • 350
  • 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
  • 22,016
  • 16
  • 145
  • 164