Home » SQL & PL/SQL » SQL & PL/SQL » regarding the script plz help
regarding the script plz help [message #209908] Mon, 18 December 2006 06:59 Go to next message
tpkumar
Messages: 3
Registered: December 2006
Junior Member
Hi All,

i have a batch file which runs three scripts let us say t1.sql,t2.sql.t3.sql.let us say if i got an error in t2.sql,is there any way that tells me that an error has occured in t2.sql and any way in batch file that i can rerun the script t2.sql based on that condition.

plz help me guys it is very urgent.

thanks in advance.
Re: regarding the script plz help [message #209921 is a reply to message #209908] Mon, 18 December 2006 09:27 Go to previous messageGo to next message
dba_blr
Messages: 43
Registered: December 2006
Member
Call each of these scripts from separate batch files and call all of them from your wraper batch file. And use the %ERRORLEVEL% DOS variable for checking whether any script returned error or not. ERRORLEVEL=0 means no error and NON-ZERO means some error has occurred.

Hope this helps...
Re: regarding the script plz help [message #209922 is a reply to message #209908] Mon, 18 December 2006 09:29 Go to previous messageGo to next message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

Sure, just depends on how you want to implement it.

Read about whenever sqlerror
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:812226355646

Since I assume you running things with sqlplus........
There are other options as well which depends on your OS.
Re: regarding the script plz help [message #209924 is a reply to message #209921] Mon, 18 December 2006 09:32 Go to previous messageGo to next message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

dba_blr wrote on Mon, 18 December 2006 16:27
Call each of these scripts from separate batch files and call all of them from your wraper batch file. And use the %ERRORLEVEL% DOS variable for checking whether any script returned error or not. ERRORLEVEL=0 means no error and NON-ZERO means some error has occurred.

Hope this helps...


He hasen't mentioned his operation system ? You assume he's running on windows..or did i miss something ?
Re: regarding the script plz help [message #209926 is a reply to message #209908] Mon, 18 December 2006 09:36 Go to previous messageGo to next message
dba_blr
Messages: 43
Registered: December 2006
Member
tpkumar wrote on Mon, 18 December 2006 18:29
Hi All,

i have a batch file which runs three scripts let us say t1.sql,t2.sql.t3.sql.let us say if i got an error in t2.sql,is there any way that tells me that an error has occured in t2.sql and any way in batch file that i can rerun the script t2.sql based on that condition.

plz help me guys it is very urgent.

thanks in advance.


I think he has mentioned that he's using a batch file. That's why I thought he may be using a Windows based OS.
Re: regarding the script plz help [message #210037 is a reply to message #209908] Tue, 19 December 2006 01:16 Go to previous messageGo to next message
tpkumar
Messages: 3
Registered: December 2006
Junior Member
Hi Guys,

Thanks for your quick reply.

Plz help me with an example.

how can i wrap them in separate batch file and how should i use %Error%Dos variable.

Thanks in advance.
Re: regarding the script plz help [message #210057 is a reply to message #209908] Tue, 19 December 2006 02:52 Go to previous messageGo to next message
tpkumar
Messages: 3
Registered: December 2006
Junior Member
Hi Guys,

Plz help me with an example.

how to wrap them in a single batch file
and how to use %ERRORLEVEL% variable to rerun the script.

Thanks in advance.
Re: regarding the script plz help [message #210060 is a reply to message #209908] Tue, 19 December 2006 03:01 Go to previous messageGo to next message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

Well this seems like some windows scripting which isn't my cup.
Port to unix or linux instead Razz
Re: regarding the script plz help [message #210062 is a reply to message #209908] Tue, 19 December 2006 03:16 Go to previous message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

http://forums.oracle.com/forums/thread.jspa;jsessionid=8d92200830de4ff711428b0c4ae88cf2b852519bb75c.e34QbhuKaxmMai0MaNeMb3eKah90?mess ageID=946063&#946063
Should be enough for you to laborate

[Updated on: Tue, 19 December 2006 03:18]

Report message to a moderator

Previous Topic: Create User problem
Next Topic: problem with cursor
Goto Forum:
  


Current Time: Sun Dec 04 16:45:03 CST 2016

Total time taken to generate the page: 0.10215 seconds