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

Home -> Community -> Usenet -> c.d.o.misc -> Batching of SQL commands

Batching of SQL commands

From: Simon Picken <simonp_at_tesseract.co.uk>
Date: 1 Aug 2002 05:16:32 -0700
Message-ID: <260f35b8.0208010416.66b5156b@posting.google.com>


Hi,

First post from a newbie so go easy! I'm accessing through Google Groups and couldn't find a FAQ for this group so apologies if this question has been asked a 100 times before.

In MS SQL I can group several statements together in a single file, open this file in Query Analyzer and run it, for example:

CREATE TABLE FIRST (<table definition>)
GO
CREATE TABLE SECOND (<table definition>) GO
CREATE TABLE THIRD (<table definition>)
GO

This works fine and creates three tables.

If I try the same kind of thing in SQL Plus, for example:

CREATE TABLE FIRST (<table definition>)
CREATE TABLE SECOND (<table definition>) CREATE TABLE THIRD (<table definition>)

I get a "Missing or invalid option" error at the CREATE TABLE SECOND line. I tried wrapping these statements in a BEGIN...END; block but that didn't help. I also get the same kind of problem when batching multiple ALTER TABLE statements.

Can anyone help?

Regards,
Simon. Received on Thu Aug 01 2002 - 07:16:32 CDT

Original text of this message

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