Ravi
Ravi

Reputation: 11

How to define varchar2

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.

Upvotes: 1

Views: 961

Answers (2)

Alexei - check Codidact
Alexei - check Codidact

Reputation: 23078

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.

Upvotes: 1

Mureinik
Mureinik

Reputation: 311393

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);

Upvotes: 5

Related Questions