Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Multiple CREATE TABLE in a .sql

Re: Multiple CREATE TABLE in a .sql

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Thu, 4 Jan 2001 23:09:23 +0100
Message-ID: <932t13$8o3bm$1@ID-62141.news.dfncis.de>

You have *two* sql statements in *one* sql buffer (as is *clearly* shown by the continuous numbering)
You'll need to have this in a file and either conclude the create table statement with a ; (which means end the statement) and a blank line or a / (which means 'run the current sql buffer')

Regards,

Sybrand Bakker, Oracle DBA

"Stephen Savage" <stephen_at_fuze-media.com> wrote in message news:3t556.4411$Ad7.130188_at_sodalite.nbnet.nb.ca...
> 1 CREATE TABLE Constructs
> 2 (
> 3 ConstructID INT PRIMARY KEY,
> 4 RegionID INT,
> 5 C_Name VARCHAR2(255),
> 6 C_Option VARCHAR2(255),
> 7 C_Address VARCHAR2(255),
> 8 C_Info VARCHAR2(255)
> 9 )
> 10 /
> 11 CREATE TABLE Regions
> 12 (
> 13 RegionID INT PRIMARY KEY,
> 14 R_Name VARCHAR2(255),
> 15 R_Population VARCHAR2(255)
> 16* )
> /
> *
> ERROR at line 10:
> ORA-00922: missing or invalid option
>
>
> "Joe" <jchvs_at_yahoo.com> wrote in message
> news:932n7n$4dd$1_at_merrimack.Dartmouth.EDU...
> > Stephen,
> >
> > You need to put the / between the create table statements, in this is
 case
> > it would be after line 9. You do not need to use the semicolon. This
 worked
> > on my 8.1.6 database.
> >
> > CREATE TABLE Constructs
> > (
> > ConstructID INT PRIMARY KEY,
> > RegionID INT,
> > C_Name VARCHAR2(255),
> > C_Option VARCHAR2(255),
> > C_Address VARCHAR2(255),
> > C_Info VARCHAR2(255)
> > )
> > /
> > CREATE TABLE Regions
> > (
> > RegionID INT PRIMARY KEY,
> > R_Name VARCHAR2(255),
> > R_Population VARCHAR2(255)
> > )
> > /
> >
> > Hope this helps,
> > Joe
> >
> >
> > "Stephen Savage" <stephen_at_fuze-media.com> wrote in message
> > news:m7556.4395$Ad7.130031_at_sodalite.nbnet.nb.ca...
> > > It works if done separately.. but there are about 30 more tables after
 these
> > > two. It doesnt seem to matter how small or simple they are if there is
 more
> > > than one it wont work. :P
> > >
> > > SQL>
> > > 1 CREATE TABLE Constructs
> > > 2 (
> > > 3 ConstructID INT PRIMARY KEY,
> > > 4 RegionID INT,
> > > 5 C_Name VARCHAR2(255),
> > > 6 C_Option VARCHAR2(255),
> > > 7 C_Address VARCHAR2(255),
> > > 8 C_Info VARCHAR2(255)
> > > 9* )
> > > 10 /
> > >
> > > Table created.
> > >
> > > SQL> CREATE TABLE Regions
> > > 2 (
> > > 3 RegionID INT PRIMARY KEY,
> > > 4 R_Name VARCHAR2(255),
> > > 5 R_Population VARCHAR2(255)
> > > 6 )
> > > 7 /
> > >
> > > Table created.
> > >
> > > SQL>
> > >
> > >
> > > "Stephen Savage" <stephen_at_fuze-media.com> wrote in message
> > > news:mp356.4373$Ad7.129354_at_sodalite.nbnet.nb.ca...
> > > > I'm opening a .SQL file in SQL Plus that has more than one CREATE
 TABLE
> > > > statement in it. I've tried placing a / at the end of each
 statement,
 but
 I
> > > > get an error at the beginning of the second statement. I've tried
 creating
> > > > the tables individually, and it works? Any ideas?
> > > >
> > > > --
> > > > Stephen Savage
> > > > stephen_at_fuze-media.com
> > > > 506.443.0950 (Main)
> > > > 506.443.0951 (Direct)
> > > > 506.457.5402 (Pager)
> > > >
> > > > Fuze Media Inc.
> > > > http://www.fuze-media.com
> > > > 573 King Street, Suite 2
> > > > Fredericton, NB
> > > >
> > > >
> > > >
> > >
> > >
> >
>
>
Received on Thu Jan 04 2001 - 16:09:23 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US