Home » Infrastructure » Unix » Pretty new to UNIX, need to know if I can do this is in unix (sun solaris (unix ksh))
Pretty new to UNIX, need to know if I can do this is in unix [message #477112] Tue, 28 September 2010 14:36 Go to next message
ncsthbell
Messages: 10
Registered: September 2010
Location: North Carolina
Junior Member
Basically what I have is a sql script "PHONE.sql" which looks like this and is being executed from the command line in UNIX:

connect xxxxx@xxxx/xxxx
set serveroutput on;
execute tblAddr1;
execute tblAddr2;
execute tblAddr3;
execute tblAddr4;

The sql script is executing procs. There is a dependancy, tblAddr1 MUST run successfully before the 'execute tblAddr2' is run.
I am confused on how to set this up. If I am running this from the command line in unix (Phone.sql), and the 1st proc fails, does the script continue on to the next execute statement or does it does it error out the script and send a return code for unix. I would also need to be able to restart the job in whichever step failed. I am thinking that to do this, I need to create it as 'PHONE.sh' and have each of the execute procs be a separate sql program so I can do error handling with the return codes and be able to restart with a specific sql program. I am pretty new at this so I hope I explained it well enough. Bottom line is that I have to create a unix shell (ksh) to run to automate the process of loading alot of data. Any guidance would be greatly appreciated!

Re: Pretty new to UNIX, need to know if I can do this is in unix [message #477113 is a reply to message #477112] Tue, 28 September 2010 14:41 Go to previous message
BlackSwan
Messages: 22839
Registered: January 2009
Senior Member
SQL> help whenever

 WHENEVER OSERROR
 ----------------

 Performs the specified action (exits SQL*Plus by default) if an
 operating system error occurs (such as a file writing error).

 WHENEVER OSERROR {EXIT [SUCCESS|FAILURE|n|variable|:BindVariable]
                   [COMMIT|ROLLBACK] | CONTINUE [COMMIT|ROLLBACK|NONE]}


 WHENEVER SQLERROR
 -----------------

 Performs the specified action (exits SQL*Plus by default) if a
 SQL command or PL/SQL block generates an error.

 WHENEVER SQLERROR {EXIT [SUCCESS|FAILURE|WARNING|n|variable|:BindVariable]
                    [COMMIT|ROLLBACK] | CONTINUE [COMMIT|ROLLBACK|NONE]}


It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/
Previous Topic: Swap Space Error -> installation 10g R2 on Solaris 10
Next Topic: RAID Level
Goto Forum:
  


Current Time: Tue Sep 30 17:30:21 CDT 2014

Total time taken to generate the page: 0.08802 seconds