Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How can I run many scripts under a path with SQL*PLUS?
"Radoulov, Dimitre" <cichomitiko_at_gmail.com> wrote in message
news:45632340$0$49208$14726298_at_news.sunsite.dk...
>
> <caifan01_at_gmail.com> wrote in message
> news:1164124559.304639.77290_at_f16g2000cwb.googlegroups.com...
>> Using SQL*PLUS I'm trying to run a set of scripts which are under a
>> certain path.
>>
>> The problem is that I may not know how many are them and I won't know
>> the names of the .sql files.
>>
>> Do you know if there is a way that '@' command accepts a directory and
>> runs all the .sql files inside the directory?
>
> You can do it in shell:
>
> for file in *.sql; do
> printf "%s\n" "@${file}"
> done | sqlplus user/pass
More efficient version:
set -- *.sql
printf "@%s\n" "$@" | sqlplus user/pass
Regards
Dimitre
Received on Tue Nov 21 2006 - 10:28:16 CST