4

我尝试使用另一个start.sql文件启动cr_tb.sql文件并收到错误奇怪的是,当我简单地将cr_tb.sql内容复制粘贴到 SQL*Plus 中时,它可以完美执行。unknown command beginning pid number...

我究竟做错了什么?(我已经发布了保管箱链接)

4

1 回答 1

4

问题的根源在于create table frclubs声明。里面有空行

表定义:

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)
);

你有两个选择:

  1. create table frclubs删除DDL 语句中的空行;

  2. SET SQLBLANKLINES ON允许 SQL*PLUS 忽略脚本发出命令中的空白行。

于 2013-08-17T21:50:43.440 回答