Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: create table statements in a given directory
In article <8t9esd$gn6$1_at_nnrp1.deja.com>,
lrako_at_hotmail.com wrote:
> Hi ,
>
> I received on a CD a whole Oracle application. The CD is structured as
> follows (more or less):
>
> C:\tables
> C:\views
> C:\procs
> C:\triggers
> ...
>
> Yes.It is on Windows NT.
>
> Each directory contains SQL DDL statements to create DB objects.
> eg: the C:\tables directory contains files named:
> PIN_ACCOUNT_HELPER.ora
> PIN_ADDRESS_HELPER.ora
> PIN_DOMAIN.ora
> PIN_CURRENCY.ora
> ....
>
> Each file is a CREATE TABLE statement which can be processed manually
> in sqlplus.
> The problem is that there are 500 tables, 1200 PROCEDURES, 350
VIEWS ...
> Impossible to process manually.
>
> So I would like to create a kind of big txt file which is a
> concatenation of all the files in a given directory.
>
> How can I do that in a NT environnement ? In UNIX it would be very
> easy...
>
> A colleague said a Perl script will do. But no one here knows Perl.
>
> Anyone can help ?
>
> Thanks
>
> Lalaina
> CRM Consultant
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Presuming that all of your SQL files have the '.ora' extension and you are accessing the CD/ROM you can code this (and that every script has an explicit 'exit'):
for /D %%d in (d:\*) do call c:\install\runscrps %%d
I would call this something similar to instobjs.bat.
The runscrps.bat file will look like this:
cd %1
for %%s in (*.ora) do sqlplus user/pass @%%s
These two short batch files should run every script you have on your CD/ROM by directory.
-- David Fitzjarrell Oracle Certified DBA Sent via Deja.com http://www.deja.com/ Before you buy.Received on Thu Oct 26 2000 - 10:57:59 CDT