shadow76it
01-09-2003, 17:01
Il mio problema e che adesso mi sto affacciando al mondo della programmazione in SQL ho questo problema. I dati sono copiati da un manuale della Jackson e non capisco l'errore che mi da' in ambiente console.
create table Salespersons
(empid integer not null primary key,
ename char(15) not null,
rank integer not null default 1 check (rank IN (1,2,3)),
salary decimal(5,2) not null
default 100.00 check (salary >=100.00));
create table Customers
(custid integer not null primary key,
cname char(15) not null,
credit char(1) not null check (credit IN ('A','B','C')));
create table Inventory
(partid integer not null primary key,
descriprion char (10) not null,
stockqty integer not null,
recorderpnt integer,
price decimal(5,2) not null);
create table Orders
(ordersid INTEGER not null primary key,
empid INTEGER not null references salespersons(empid),
custid INTEGER not null references customers(custid),
salesdate DATE NOT NULL DEFAULT CURRENT_DATE,
item1 INTEGER REFERENCES Inventory(partid),
qty1 INTEGER,
item2 INTEGER REFERENCES Inventory(partid),
qty2 INTEGER,
item3 INTEGER REFERENCES Inventory(partid),
qty3 INTEGER,
item4 INTEGER REFERENCES Inventory(partid),
qty4 INTEGER,
item5 INTEGER REFERENCES Inventory(partid),
qty5 INTEGER);
mi da questo messaggio
Server: messaggio 156, livello 15, stato 1, riga 24
Sintassi non corretta in prossimitā della parola chiave 'CURRENT_DATE'.
Grazie per l'aiuto
create table Salespersons
(empid integer not null primary key,
ename char(15) not null,
rank integer not null default 1 check (rank IN (1,2,3)),
salary decimal(5,2) not null
default 100.00 check (salary >=100.00));
create table Customers
(custid integer not null primary key,
cname char(15) not null,
credit char(1) not null check (credit IN ('A','B','C')));
create table Inventory
(partid integer not null primary key,
descriprion char (10) not null,
stockqty integer not null,
recorderpnt integer,
price decimal(5,2) not null);
create table Orders
(ordersid INTEGER not null primary key,
empid INTEGER not null references salespersons(empid),
custid INTEGER not null references customers(custid),
salesdate DATE NOT NULL DEFAULT CURRENT_DATE,
item1 INTEGER REFERENCES Inventory(partid),
qty1 INTEGER,
item2 INTEGER REFERENCES Inventory(partid),
qty2 INTEGER,
item3 INTEGER REFERENCES Inventory(partid),
qty3 INTEGER,
item4 INTEGER REFERENCES Inventory(partid),
qty4 INTEGER,
item5 INTEGER REFERENCES Inventory(partid),
qty5 INTEGER);
mi da questo messaggio
Server: messaggio 156, livello 15, stato 1, riga 24
Sintassi non corretta in prossimitā della parola chiave 'CURRENT_DATE'.
Grazie per l'aiuto