简体   繁体   中英

ORA-00907: missing right parenthesis at query ALTER TABLE Table_Name MODIFY Column_Name

I have a database where I want to execute this SQL query:

ALTER TABLE PARAM_DEF MODIFY UNIT VARCHAR2(400 BYTES);

In SQL Server it works without any problem but in Oracle I get this error:

Error report -
SQL Error: ORA-00907: missing right parenthesis
00907. 00000 -  "missing right parenthesis"

Why does it not work at my Oracle database?

The keywords for character length semantics are CHAR and BYTE - not BYTES , so just correct that to:

ALTER TABLE PARAM_DEF MODIFY UNIT VARCHAR2(400 BYTE);

Demo:

create table param_def (unit varchar2(200 byte));

Table PARAM_DEF created.

ALTER TABLE PARAM_DEF MODIFY UNIT VARCHAR2(400 BYTE);

Table PARAM_DEF altered.

desc param_def

Name Null? Type          
---- ----- ------------- 
UNIT       VARCHAR2(400) 

Remove bytes in varchar2

   ALTER TABLE PARAM_DEF MODIFY 
   UNIT VARCHAR2(400);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM