Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create multiple tables error

Status
Not open for further replies.

crystalhelp

Programmer
May 13, 2002
56
0
0
CA
I feel so stupid that I can't figure this out. I am writing a script that creates several tables. Essentially it starts out as:

create table x(
a number,
b number);

create table y(
c number,
d number);

create table z(
e number,
f number);

begin
--my variable declaration
-- a bunch of insert statements etc.
end;

I keep getting the error ORA-00911 Invalid Character. It won't tell me where the invalid character is. If I run each of the create table statements alone, it works, but when I select all of the create table statements together and run them I get the error.

What is the syntax you use between each create statement?
 
How are you executing the file you have created? Try executing the file using the @<filename> if you are not.

flstf
 
I'm using TOAD. I am hitting the green execute statement arrow. I am creating this file to pass along to someone else. I have no idea how they will execute it. I am just running it to make sure it runs cleanly. I assume if it doesn't work how I am running it, it won't work how this person will run it.
 
Have you tried removing the blank lines between the create statements?
FLSTF
 
Yeah, didn't work. Thanks anyway. If you have any other ideas, let me know. I may have to resort to sending the guy several files with each of the create table statements in their own file.
 
Found the answer. The green execute arrow just runs one statement. Try executing the script using the page with two green arrowws pointing to it. (execute all of current window as script) button. It worked for me for your example. I couldn't find anything wrong with your script but haven't really used TOAD much.

FLSTF
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top