Home » SQL & PL/SQL » Client Tools » how to run all sql scripts from one script (oracle 11g)
how to run all sql scripts from one script [message #596255] Thu, 19 September 2013 09:43 Go to next message
prabhakar445
Messages: 5
Registered: October 2011
Location: bangalore
Junior Member
Hi All,

How to run all sql scripts from one script

For ex : one.sql,two.sql,three.sql...ten.sql

Now i need to run all these scripts from one script like onetoten.sql and the out put should be display all script names and from each script i need to display first 2 outputs

I need out put like below

SQL>@onetoten.sql

output should like..

SQL>@one.sql

Table Truncated

Table Truncated

SQL>@two.sql

Table Truncated

Table Truncated

.
.
.
.
.
SQL>@ten.sql

Table Truncated

Table Truncated

For example i have placed trucnate querys in all scripts.

Can any one help me how can get output like above..

Thanks in advance..
Re: how to run all sql scripts from one script [message #596256 is a reply to message #596255] Thu, 19 September 2013 09:46 Go to previous messageGo to next message
cookiemonster
Messages: 10959
Registered: September 2008
Location: Rainy Manchester
Senior Member
script would be:
@one.sql
@two.sql
.....


What's the difficulty?
Re: how to run all sql scripts from one script [message #596267 is a reply to message #596255] Thu, 19 September 2013 13:29 Go to previous messageGo to next message
Lalit Kumar B
Messages: 2294
Registered: May 2013
Location: World Wide on the Web
Senior Member
prabhakar445 wrote on Thu, 19 September 2013 20:13
and from each script i need to display first 2 outputs

Why? If you normally spool the output you would have the complete information. Why only 2 outputs? what's exactly in the sql files?
Re: how to run all sql scripts from one script [message #596294 is a reply to message #596267] Fri, 20 September 2013 01:15 Go to previous messageGo to next message
prabhakar445
Messages: 5
Registered: October 2011
Location: bangalore
Junior Member
Hi,

While doing refresh tasks at the time of post refresh we are running some scripts like...passwords,roles and their privileges etc...

If i put spool the log file will become very large...so what am thinking the script should be run completly but i need to extract only first 2 or 3 outputs from that script and save it in to one log file. so because of this the log file size will be less and we can able to share with customer easly. I am not sure if it is possible or not but am thinking in this way.
icon5.gif  Re: how to run all sql scripts from one script [message #596295 is a reply to message #596294] Fri, 20 September 2013 01:22 Go to previous message
Michel Cadot
Messages: 59062
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

spool one
Q1
Q2
Q3
spool off
Q4
Q5
...

...

Previous Topic: Date result different for same query in Toad and SQL Developer
Next Topic: char differences between SQL+ and SQL developer
Goto Forum:
  


Current Time: Sun Sep 14 23:47:52 CDT 2014

Total time taken to generate the page: 0.07014 seconds