Reputation: 247
I've decided to completely put out the SQL file here.
CREATE TABLE Account
(
AccountNumber INTEGER NOT NULL PRIMARY KEY,
Name varchar(30) NOT NULL
);
CREATE SEQUENCE SEQ_ADDR START WITH 1 INCREMENT BY 1;
CREATE TABLE Address
(
AddressNumber INTEGER NOT NULL PRIMARY KEY,
AccountNumber INTEGER NOT NULL,
IsPrimary INTEGER NOT NULL,
StreetName varchar(50) NOT NULL,
ZipCode INTEGER NOT NULL
);
CREATE TABLE Bill
(
AccountNumber INTEGER NOT NULL,
EndDate DATE NOT NULL,
StartDate DATE NOT NULL,
DueDate DATE NOT NULL,
CONSTRAINT BillFK FOREIGN KEY (AccountNumber) REFERENCES Account(AccountNumber),
CONSTRAINT BillPK PRIMARY KEY (AccountNumber, EndDate)
);
Again, the error I'm getting begins with the first Constraint call (unknown command beginning "CONSTRAINT..." - rest of line ignored.). I'm also occasionally getting an 'unknown command ")" - rest of line ignored.' Any ideas?
Upvotes: 2
Views: 5327
Reputation: 17920
Any empty lines will stop SQL*Plus
from accepting the inputs blocks and put it in buffer.
So, when you started your CONSTRAINT
keyword after an empty line, it treated it as a new command, and thrown an error.
Try this, before you run all your DDLs
.
set sqlblanklines on
You need to instruct the sql*plus to ignore empty lines
Upvotes: 13