Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How to call scripts from another scripts ?

Re: How to call scripts from another scripts ?

From: Maxim Demenko <mdemenko_at_gmail.com>
Date: Thu, 15 Mar 2007 10:21:55 +0100
Message-ID: <45F91033.8080407@gmail.com>


krislioe_at_gmail.com schrieb:
> Hi all,
>
> During development, we make database structure/constraint
> modifications into sql file (scripts). So I will have some single
> script files, e.g : script1.sql, script2.sql, script3.sql etc.
>
> Then I create a mainscript.sql to call all the scripts. So I need only
> to execute @mainscript.sql, which in turn execute script1.sql,
> script2.sql, script3.sql.
>
> mainscript.sql :
> @script1.sql;
> @script2.sql;
> @script3.sql;
> commit;
>
> The question is :
> How can I rollback if one of the script fails ?
>
> Thank you for your help,
> xtanto
>

If you are executing your scripts via sqlplus, there is a handy command WHENEVER SQLERROR EXIT ROLLBACK http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14357/ch12052.htm#i2700066

Best regards

Maxim Received on Thu Mar 15 2007 - 04:21:55 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US