Reputation: 233
I try to start cr_tb.sql file using another start.sql file and get an error unknown command beginning pid number...
The strange thing is that when I simply copy paste the cr_tb.sql content into the SQL*Plus, it executes perfectly.
What am I doing wrong? (I have posted the dropbox links)
Upvotes: 4
Views: 1129
Reputation: 27251
The root of the problem lays in the create table frclubs
statement. There are blank lines in
the table definition:
create table frclubs
(
-- here they are
pid number(2) not null,
clubid number(2) not null,
constraint cPIDCLUBIDPK primary key(pid,clubid),
constraint fPIDFK foreign key(pid) references friends(pid),
constraint fCLUBIDFK foreign key(clubid) references clubs(clubid)
);
You have two choices:
Remove blank lines in the create table frclubs
DDL statement;
Allow SQL*PLUS ignore blank lines in the script issuing SET SQLBLANKLINES ON
command.
Upvotes: 4