ORA-00902: invalid data type

I get the above error when I run the following query

create table customer (
  cust_fname   varchar2(15) NOT NULL,
  cust_lname   varchar2(15) NOT NULL,
  cust_id      number(9,0) NOT NULL,
  address      varchar2(40) NOT NULL,
  city         varchar2(14) NOT NULL,
  postal_code  number(6,0) NOT NULL,
  country      varchar2(14) NOT NULL,
  phone_no     number(12,0) NOT NULL,
  e-mail       varchar2(30) NOT NULL,
  password     varchar2(10) NOT NULL,
  primary key(cust_id),
  check(e-mail like '_%@_%._%')
);

Please tell us what the problem is.

+4
source share
1 answer
e-mail uses a hyphen in field name.

change it to e.g. e_mail or email.

you should not use (hyphen) - field name.

You can use - , but that would not be a wise decision, you would need to correctly indicate each time you request a field / table that uses hyperlinks or other unsupported characters.

+5
source

All Articles