Home > Back-end >  I need to create a table but i am getting error of invalid option or missing
I need to create a table but i am getting error of invalid option or missing

Time:12-28

CREATE TABLE deposit-1035(
Actno Varchar2(25),
Cname Varchar(25),
Bname Varchar2(25),
Amount Number(8,2),
Adate date);

ORA-00922: missing or invalid option This is error i am getting why?

CodePudding user response:

You can't use minus sign in object name deposit-1035

try use an underscore

CREATE TABLE deposit_1035

or if you really need minus use backtics arount the object name `

deposit_1035  `deposit-1035`

CodePudding user response:

MySQL does not have a VARCHAR2 column type (which is Oracle syntax). Also, place backticks around the table name. Try the following version:

CREATE TABLE `deposit-1035` (
    Actno VARCHAR(25),
    Cname VARCHAR(25),
    Bname VARCHAR(25),
    Amount NUMBER(8,2),
    Adate DATE
);
  • Related