4

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)

1
  • Seems like you have posted the same link for both files mate. Commented Aug 17, 2013 at 21:17

1 Answer 1

4

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:

  1. Remove blank lines in the create table frclubs DDL statement;

  2. Allow SQL*PLUS ignore blank lines in the script issuing SET SQLBLANKLINES ON command.

Sign up to request clarification or add additional context in comments.

1 Comment

Can we conditionally execute statement? Like - DECLARE counter int; BEGIN SELECT COUNT(*) INTO counter FROM user_tables WHERE table_name = UPPER('OOLD_SFWID_CHG_LOG_TAB_DESC'); IF counter = 1 THEN @C:\Users\umishra\Desktop\GE-5560\secondfile; END IF; END; / But it does not work

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.