Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to create a table in a script?
Hi Arno,
Based on your description what you are doing should work. The following will work.
Contents of file called: cr_tbls.sql
CREATE TABLE test1 (
id number(7), description varchar2(30)); CREATE TABLE test2 ( ssn number(9), first varchar2(20), last varchar2(20));
Once you have built the file you can either do:
sqlplus <user>/<password> @cr_tbls
or
sqlplus <user>/<password>
SQL> @cr_tbls
You should wind up with a message saying tables created.
regards
Jerry Gitomer
Arno van Rossum wrote in message <372F18F7.EE1B8FF9_at_mmp-obec.nl>...
>Hello all,
>
>This may be an easy question (I hope so :-) but I can't find the answer.
>We used to use MS SQL server and a script to recreate all our tables in
>a the database.
>
>Now we've switched to oracle and I've converted all ms-sql to oracle
>understandable sql-statements. All works fine when i run the create
>statements one by one, but I would like to use a script or batch file to
>create all tables, stored procedures and constraints.
>
>I've put them all in one file, separated by ; but then sql*plus doesn't
>create all tables saying "input to long" or something alike. (All buffer
>settings in the enviremont of sql*plus are at the max.) Then I tried
>pl/sql, but that doesn't work either. Documentation says you can't use
>create and alter within pl/sql.
>
>Does anyone know an simple (easy :-) way how to do this?
>
>Thanks
>
>Arno van Rossum
>a.van.rossum_at_mmp-obec.nl
Received on Tue May 04 1999 - 12:17:06 CDT
![]() |
![]() |