Procedure execution

Hi

I have four procedure .I want to execute one by one in unix

PROCEDURE 1
PROCEDURE 2
PROCEDURE 3
PROCEDURE 4

it should execute in such a way that if PROCEDURE 1 finish successfully only , it should go and execute the procedure 2 , else I need to exit from the script by echo the error

Can some one help me here

PROCEDURE 1 &&
PROCEDURE 2 &&
PROCEDURE 3 &&
PROCEDURE 4 || echo error
       A list is a sequence of one or more pipelines separated by one of the operators ;, &, &&, or ||, and optionally
       terminated by one of ;, &, or <newline>.

       Of these list operators, && and || have equal precedence, followed by ; and &, which have equal precedence.

       A sequence of one or more newlines may appear in a list instead of a semicolon to delimit commands.

       If  a  command  is  terminated by the control operator &, the shell executes the command in the background in a
       subshell.  The shell does not wait for the command to finish, and the return status is 0.   Commands  separated
       by  a ; are executed sequentially; the shell waits for each command to terminate in turn.  The return status is
       the exit status of the last command executed.

       The control operators && and || denote AND lists and OR lists, respectively.  An AND list has the form

              command1 && command2

       command2 is executed if, and only if, command1 returns an exit status of zero.

       An OR list has the form

              command1 || command2

Of course, I've made an assumption about what you mean by PROCEDURE - i.e. in what context are you using procedures? Shell? Database? Some other language?

Thanks..

Actually I am using a oracle procedure here

Procedures don't return values. Perhaps you'd need to set something, perhaps a global variable to indicate success or failure of each procedure. Otherwise, use functions.

I'll see if I have a VM handy with Oracle installed, and play around. I'll report back!

You have to use

WHENEVER SQLERROR EXIT SQL.SQLCODE 

this will make sure you will exit from Oracle session if any of your procedure encounter with any SQL error code.