I'm trying to create a basic table (Diak) using an SQL script, and it keeps giving me ORA-00907 on the first line.
However, I create another table (Targy) with basically the same structure, and that gets created just fine.
create table Diak (
Diak_id rowid constraint pk_diak primary key,
Nev varchar2(100),
Szul_datum date szul_70_tol constraint check (Szul_datum>= date'1970-1-1'),
Cim long,
Kod varchar2(100) constraint uk_diak_kod unique,
Kezdes_eve number(4) constraint kezdes_88_tol check (Kezdes_eve>= 1988),
);
create table Targy (
Targy_id rowid constraint pk_targy primary key ,
Nev long,
Kod varchar2(100) constraint uk_targy_kod unique,
Eloado varchar2(100) default 'Bármi Áron',
Napok varchar2(100),
Hely varchar2(100)
);
It says "Error starting at line : 1 in command […] 00907. 00000 - "missing right parenthesis" ". Since Targy table is fine, I don't know what the problem is with Diak table.
You are not declaring the
CHECKconstraint properly; just remove thexxxxx CONSTRAINTpart and you should be fine:Demo on DB Fiddle.
Note: there is also a trailing comma at the end of the declaration of the last column, but I assume this is a typo.