missing error a parenthesis to the right ORA-00907

1

Hi, I'm a newbie in sql code and they ask me to create tables with sql. When creating the table I get the error of missing a parenthesis on the right ORA-00907 and I can not find the cause.

This is the structure that I have created.

create table ALUMNOS(
nombre_id varchar2 (30),
apellido1 varchar2 (30),
apellido2 varchar2 (30),
nif varchar (10),
direccion varchar2 (100),
sexo varchar (10),
f_nac date (20),
cur_mat number (10),
primary key (nombre_id));

Thanks for the help and greetings.

    
asked by chobi 28.11.2017 в 20:09
source

1 answer

1

I'm sorry that the error message is not very useful in this case.

The error is that you should not specify a length of type DATE . If you remove the (20) , the sentence will work:

create table ALUMNOS(
nombre_id varchar2 (30),
apellido1 varchar2 (30),
apellido2 varchar2 (30),
nif varchar (10),
direccion varchar2 (100),
sexo varchar (10),
f_nac date, -- quita el (20) aquí
cur_mat number (10),
primary key (nombre_id));
    
answered by 28.11.2017 в 20:23