2016-04-22 6 views
1

Ich versuche, eine Einschränkung zu erstellen, um zu gewährleisten, dass Spalten unterschiedliche Werte haben, aber immer einen Fehler in der Zeile timesheet_approved erhalten.Orakel fehlende rechte Klammer (Zeile 7)

create table Funtom_timesheet 
(
timesheet_ID   number(3) constraint timesheet_pk primary key, 
timesheet_Emp   number(3) constraint timesheet_Emp not null references funtom_employee, 
timesheet_Wc   date  constraint timesheet_Wc not null, 
timesheet_OT   number(2) default 0, 
timesheet_Approved number(3) constraint timesheet_approved_uc unique(timesheet_Approved,timesheet_Emp) constraint timesheet_approved references funtom_employee 
) 
; 
+0

Überprüfen Sie die Tabelle Syntax erstellen auf [Techonthenet] (http://www.techonthenet.com/oracle/tables/create_table.php), [docs.oracle.com] (http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_7002.htm) – Spidey

Antwort

0

Ich denke, Mehrspaltenbedingungen sind nicht Teil der Spaltendefinition. Versuchen Sie, sie Aussondern:

create table Funtom_timesheet (
    timesheet_ID   number(3) constraint timesheet_pk primary key, 
    timesheet_Emp   number(3) constraint timesheet_Emp not null references funtom_employee(??), 
-------------------------------------------------------------------------------------------------------^ 
    timesheet_Wc   date  constraint timesheet_Wc not null, 
    timesheet_OT   number(2) default 0, 
    timesheet_Approved number(3), 
    constraint timesheet_approved_uc unique(timesheet_Approved,timesheet_Emp), 
    constraint timesheet_approved references funtom_employee(??) 
-------------------------------------------------------------^ 
); 

Und füllen Sie in der Spalte für die Referenzen

+0

das hat den anfänglichen Fehler losgeworden, aber jetzt habe ich einen Fehler zu sagen unbekannter Befehl")" –